Training and Test images must be of equal size! OpenCV Crash iOS

asked 2018-02-19 11:48:30 -0500

fellowDev gravatar image

I am using the fisher face recognizer. When I call the predict function the app crashes. This is what it says in the logs...

    Face DetectedOpenCV(3.4.0-dev) Error: Bad argument (Wrong input image size. Reason: Training and Test images must be of equal size! Expected an image with 12000000 elements, but got 1296.) in predict, file /Users/Name/Desktop/OpenCVBuild/opencv_contrib/modules/face/src/fisher_faces.cpp, line 140
    libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.0-dev) /Users/Name/Desktop/OpenCVBuild/opencv_contrib/modules/face/src/fisher_faces.cpp:140: error: (-5) Wrong input image size. Reason: Training and Test images must be of equal size! Expected an image with 12000000 elements, but got 1296. in function predict

(lldb)

My training test images are the same size (3000x4000). What is the problem and how would I fix it?

edit retag flag offensive close merge delete

Comments

1: I think there might be a typo in your question. Did you mean the image sizes are (300X400)? 2: I would highly recommend you write a small program that iterates over the images and confirms if the sizes are equal.

eshirima gravatar imageeshirima ( 2018-02-19 12:52:51 -0500 )edit