我想改变一下摄像头输入图像的分辨率,于是调用了一下opencv中resize函数,代码如下:
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
Imgproc.resize(inputFrame.rgba(),next,new Size(640,360));
return next;
}
结果报错了,真机调试时候是黑屏的
05-02 23:07:58.423 30806-30891/? E/cv::error(): OpenCV Error: Assertion failed (src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols) in void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean), file /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp, line 97
05-02 23:07:58.423 30806-30891/? E/org.opencv.android.Utils: nMatToBitmap catched cv::Exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp:97: error: (-215) src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)
05-02 23:07:58.423 30806-30891/? E/CameraBridge: Mat type: Mat [ 360*640*CV_8UC4, isCont=true, isSubmat=false, nativeObj=0x5b3bbd20, dataAddr=0x614a3010 ]
05-02 23:07:58.423 30806-30891/? E/CameraBridge: Bitmap type: 1280*720
05-02 23:07:58.424 30806-30891/? E/CameraBridge: Utils.matToBitmap() throws an exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/
这是日志。。。请问哪里出现了问题呢。。?希望大神指点一二
|