MasteringOpenCV / code

Code for the book "Mastering OpenCV with Practical Computer Vision Projects" by Packt Publishing 2012.
Other
2.72k stars 1.64k forks source link

Chapter6_NonRigidFaceTracking : train_patch_model not working #59

Closed vishnumurali92 closed 8 years ago

vishnumurali92 commented 8 years ago

When i try to run train_path_model it shows the exception ,

training patch 0... OpenCV Error: Assertion failed (src.cols > 0 && src.rows > 0) in warpAffine, file /home/alpha/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 5573 terminate called after throwing an instance of 'cv::Exception' what(): /home/alpha/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp:5573: error: (-215) src.cols > 0 && src.rows > 0 in function warpAffine

Aborted (core dumped)

please help me solve this issue ...i am using opencv 3.0 can anyone post a link to the patch_model.yaml file ....

BloodAxe commented 8 years ago

Looks like you passed empty image to input. Please validate your input parameters.

vishnumurali92 commented 8 years ago

i tried to display the input image and i was able to display the first input image(in file patch_model.cpp)... before the second iteration the exception occurs ...

shervinemami commented 8 years ago

The author of that chapter said if you can narrow down where in the code this is actually happening maybe he can suggest something.

shervinemami commented 8 years ago

(Try to find the exact line number that is calling warpAffine, and print out the value of the image rows & cols, and describe more about what you were doing that causes the error, because you probably have an empty image but it isn't obvious why you would have an empty image)

vishnumurali92 commented 8 years ago

when i try to view the image in the function "patch_models::train" i am able to see the gray scale image even though have the exception : OpenCV Error: Assertion failed (size.width >0 && size.height>0) in imshow

the warpAffine function is in line 173 in file path_model.cpp.I am able to print the image rows and cols of the input image and the output image after the wrapAffine function.

vishnumurali92 commented 8 years ago

I found out the error ..thank you very much for your help ...I did not had the second input image in my directory ,that was the error ..