Face recognition using Eigen faces error Image step is wrong

asked 2013-05-22 08:57:53 -0600

pp gravatar image

I am doing face recognition using EigenFace Recognizer to recognize a face from training dataset i.e trained image. I have used the javacv and opencv library to developer android based face recognition using java . when i make a call to int predictedLabel =faceRecognizer.predict(test_resizeimg); i get error

OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed) in cv::Mat cv::Mat::reshape(int, int) const, file /home/saudet/android/OpenCV-2.4.3/modules/core/src/matrix.cpp, line 801

can anybody advice me how to resolve this issue.

edit retag flag offensive close merge delete

Comments

what are you doing to reize the image ? could that lead to a 'padded' / non-continuous image ?

berak gravatar imageberak ( 2013-05-22 09:17:44 -0600 )edit

i have converted first the detected croped face to gray image using cvConvert() and then i used the cvResize(img scr, img dest) to resize the image.

pp gravatar imagepp ( 2013-05-22 12:10:24 -0600 )edit

Hi, Did you find any solution ? I am also facing the same error. Although I think I have done the necessary things, all my training images are in greyscale and of same size. Then test image which I am capturing is also converted to greyscale and then resized to the size required for testing. But still its showing the error.

And the most strange thing is, It working in Windows with no error. The above error is for Ubuntu 12.04.

-Thanks

piyush gravatar imagepiyush ( 2014-03-30 12:09:31 -0600 )edit