Viola-Jones algorithm don't work properly in OCV 2.0 (Bug #108)
Description
The following function yields different resutls in OCV1.0 and OCV2.0:
faces = cvHaarDetectObjects( image, cascade, storage, 1.15, threshold, CV_HAAR_DO_CANNY_PRUNING,cvSize(0, 0));
The "haarcascade_frontalface_alt.xml" cascade from OCV 1.0 was used in both test. The sample images demosntrating this problem are attached to the ticket
Associated revisions
Merge pull request #108 from ilya-lavrenov:gitignore
History
Updated by Maria Dimashova almost 15 years ago
Updated by anonymous - almost 15 years ago
Since OpenCV 2.1.0 cvHaarDetectObjects() uses TBB instead of OpenMP for parallelization, so the problem is probably solved. If not, please, reopen the ticket.
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Sven Utcke almost 14 years ago
Hi,
I would like to reopen this bug (as I think I am observing the same problem). Running the exactly same (python) code with OpenCV 1.0 from Ubuntu 8.04 works just as expected (i.e. only a reasonable number of false positives is found), while running it with OpenCV 2.1 from Ubuntu 10.10 fails miserably --- where before I had one or two false positives, I now have 30--40, most in areas of very little contrast, which should have been filtered out by CV_HAAR_DO_CANNY_PRUNING (which does filter out some, but only 3-4 of the 30-40 false positives). Any idea how to work around this?
You can find example images showing the effect at:
1.0, works: http://www.svenutcke.de/sw/Face/peter10.jpg --- as you can see, only one false positive was found.
2.1, fails: http://www.svenutcke.de/sw/Face/peter21.jpg --- as you can see, many more false positives are found, even though this is the same image, the same program and using the same parameters.
Any ideas? BTW, if you would like to try it yourself, the program in question can be found here:
http://www.svenutcke.de/sw/Face/
Let me know if you need anything more. I would be very interested to find a way to work around this bug even in affected versions of opencv (as it would be difficult to ask normal users to install OpenCV from code, just so that face detection works).
Thanks
- Status changed from Done to Cancelled
- (deleted custom field) deleted (
fixed)
Updated by Maria Dimashova over 13 years ago
Hi,
Thanks for the report.
I've tried to reproduced the problem with trunk r5937. I've used the images opencv_extra/testdata/cv/cascadeandhog/images/addams-family.png and class57.png, because you did not attach the image peter.jpg (without any marking) tested by you. I've run facedetect sample (original and with replaced CV_HAAR_SCALE_IMAGE by CV_HAAR_DO_CANNY_PRUNING) for the cascade opencv/data/haarcascades/haarcascade_frontalface_alt.xml. For both OpenCV configures (with and without TBB) I've got the same detection results and they are expected (the maximum of false positives were equal to 2).
Please, test your program or facedetect sample with OpenCV 2.3.0 or r5937 on your data (image and cascade). If you'll get the problem again, please, reopen this ticket and attach used data (image and cascade).
- Status changed from Cancelled to Done
- (deleted custom field) set to worksforme