Question

OpenCV Error: Assertion failed (rect.width >= 0 && rect.height >= 0 && rect.x <
image->width && rect.y < image->height && rect.x + rect.width >= (int)(rect.widt
h > 0) && rect.y + rect.height >= (int)(rect.height > 0)) in unknown function, f
ile c:\Users\vp\work\ocv\opencv\modules\core\src\array.cpp, line 3006

I get this error when I do sampling of the positive images. I have a total of 1200 positive samples. In many places it mentioned that the dimensions being passed to CvSetImageROI() are greater than the maximum dimension allowed.
I am using a web cam that produces images with dimensions of 640x480.

Code for Sampling: opencv_createsamples.exe -info lent.txt -vec vec\Samples.vec -w 24 -h 24 Other thing that I did was changing the dimensions of the samples to 30x32/30x30/32x32 and many,but the error persists.

What do I do now ? NB: This could be a possible duplicate question, but the previous ones did not help me.

Please help!

Was it helpful?

Solution

There was some error in saving the ROI of the images. The first image could not satisfy the dimensions and hence it raised the error!

I have solved that error!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top