Qualeams / Android-Face-Recognition-with-Deep-Learning-Library

Face Recognition library for Android devices is an Android library (module) which includes several face recognition methods.
Apache License 2.0
371 stars 135 forks source link

Openencvyolo error in Android studio #37

Open codingyoutub opened 3 years ago

codingyoutub commented 3 years ago

If you do it, you'll end up with a tingling problem.

studypage : https://docs.opencv.org/3.4/d0/d6c/tutorial_dnn_android.html

logcat : 2021-05-16 01:56:36.396 27600-27600/com.example.yolov3opencvex E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV 2021-05-16 01:56:38.092 27600-27729/com.example.yolov3opencvex E/cv::error(): OpenCV(4.5.2) Error: Bad argument (The total number of matrix elements is not divisible by the new number of rows) in reshape, file /build/master_pack-android/opencv/modules/core/src/matrix.cpp, line 1186 2021-05-16 01:56:38.095 27600-27729/com.example.yolov3opencvex E/org.opencv.core.Mat: Mat::n_1reshape__JII() caught cv::Exception: OpenCV(4.5.2) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:1186: error: (-5:Bad argument) The total number of matrix elements is not divisible by the new number of rows in function 'reshape' 2021-05-16 01:56:38.097 27600-27729/com.example.yolov3opencvex E/AndroidRuntime: FATAL EXCEPTION: Thread-4 Process: com.example.yolov3opencvex, PID: 27600 CvException [org.opencv.core.CvException: cv::Exception: OpenCV(4.5.2) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:1186: error: (-5:Bad argument) The total number of matrix elements is not divisible by the new number of rows in function 'reshape' ]

error line : detections = detections.reshape(1, (int) detections.total() / 7);

How do we deal with this?