As the illustration shows, now i have the 'original' frame, not fill fully the screen. And i expect to got a fullscreen frame like below part, so i choose using imgproc.resize to achieve this, but when i run my app on the mobilephone, the app quit unexpectedly, i don't know why, anyone can help me ? Thanks !
Here is some related code:
public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
Mat frame = inputFrame.rgba();
Mat dst = new Mat();
Imgproc.resize(frame,dst,new Size(),1.5,1.5,Imgproc.INTER_LINEAR);
frame.release();
return dst;
}
And this is debug error report: E/cv::error(): OpenCV(3.4.7) 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 /build/3_4_pack-android/opencv/modules/java/generator/src/cpp/utils.cpp, line 101 E/org.opencv.android.Utils: nMatToBitmap caught cv::Exception: OpenCV(3.4.7) /build/3_4_pack-android/opencv/modules/java/generator/src/cpp/utils.cpp:101: error: (-215:Assertion failed) 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)' E/CameraBridge: Mat type: Mat [ 16202880CV_8UC4, isCont=true, isSubmat=false, nativeObj=0xffffffffc9934a88, dataAddr=0xffffffffc3100000 ] E/CameraBridge: Bitmap type: 19201080 E/CameraBridge: Utils.matToBitmap() throws an exception: OpenCV(3.4.7) /build/3_4_pack-android/opencv/modules/java/generator/src/cpp/utils.cpp:101: error: (-215:Assertion failed) 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)'