VTR2015
VTR2015

Reputation: 439

Detect faces in portrait mode using OpenCV

I have the problem of using OpenCV 2.4.11 in portrait and make the recognition of faces. I used the following code but does not work, the screen goes black and the log shows these errors ... how can I fix it and use the camera more OpenCV in portrait recognize faces?

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 /home/reports/ci/slave_desktop/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp, line 97

Utils.matToBitmap() throws an exception: /home/reports/ci/slave_desktop/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)

I checked this means, but I can not understand where to change the orientation to portrait to have the camera preview in fullscreen and recognize faces.

Upvotes: 1

Views: 1037

Answers (1)

VTR2015
VTR2015

Reputation: 439

I found a solution. On this page give an example of how to customize the OpenCV camera class and with this recognition and both the camera preview in portrait work.

Upvotes: 0

Related Questions