Opencv Android JavaCameraView的FPS非常低

时间:2018-08-24 14:43:21

标签: android opencv object-detection frame-rate javacameraview

我一直在进行对象检测,并且在android中使用opencv取得了很多成就,但是,我发现JavaCameraView使用的分辨率非常低,我需要更好的分辨率,因为我必须检测文本在检测到对象后拍摄的照片上,因此我在CameraBridgeViewBase.java的这一行中更改了对象的分辨率:

// NOTE: The order of bitmap constructor and camera connection is important for android 4.1.x
// Bitmap must be constructed before surface
private void onEnterStartedState() {
    Log.d(TAG, "call onEnterStartedState");
    /* Connect camera */
    Log.d("RESOLUTION_TAG", "camera initialized with: "+getWidth()+";"+getHeight());
    if (!connectCamera(mMaxWidth, mMaxHeight)) { //here i changed it
        AlertDialog ad = new AlertDialog.Builder(getContext()).create();
        ad.setCancelable(false); // This blocks the 'BACK' button
        ad.setMessage("It seems that you device does not support camera (or it is locked). Application will be closed.");
        ad.setButton(DialogInterface.BUTTON_NEUTRAL,  "OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                ((Activity) getContext()).finish();
            }
        });
        ad.show();

    }
}

我将其更改为2160x3840,这不是我的手机相机的最大分辨率,问题是相机的FPS真的很低,并且我已经测试了其他opencv应用程序,它们的图像质量非常好但是即使没有进行对象检测,FPS仍然很低,也不要遭受如此低的fps计数,那么,这里的解决方案是什么? JavaCamera2View固定了吗?我对此需要帮助

0 个答案:

没有答案