I am using opencv 2.4.4 installed via macports with python 2.7.5 on mac os x 10.7.5.
I want to train a cascade to look for male frontal faces. But I get a terminate called throwing an exceptionAbort trap: 6 error. I ask the SO community to help me figure out what could go wrong.
Negative (background) image taken from google: googleImages_noFaces (293 images)
Positive images taken from Karolinskaya database: trainingSet (70 images)
I created a text file that indicates the relative location of the background images: bgDesc.txt
I also created a text file indicating the relative location, the number of positive instances in the image (which is always 1) and the bounding area of ββthe object (which is the full image): maleDesc.txt
All these files can be downloaded from here .
Organizing files in this form:
/trainingSet image1.jpg image2.jpg . . . /googleImages_noFaces image1.jpg image2.jpg . . . /cascadeFiles maleDesc.txt bgDesc.txt
when I use opencv_createsamples, the maleDesc.vec file maleDesc.vec successfully created with the following line:
opencv_createsamples -vec maleDesc.vec -info maleDesc.txt -bg bgDesc.txt -num 70 -w 24 -h 24
if I use the -show , I see that 24x24 pixel images are created.
Then i will try
opencv_traincascade -data cascadeFiles -vec maleDesc.vec -bg bgDesc.txt -numPos 70 - numNeg 293 -numStages 1 -precalcValBufSize 500 -precalcIdxBufSize 500 -featureType LBP -w 24 -h 24
Which gives me an error.
I tried different values ββof -numPos , such as 10, 20, etc. up to 70, as well as various -numNeg values ββlike 30, 60, etc. to 293. I tried to use numPos values ββthat are less than numNeg values ββand even those that are larger. I also tried different values ββof -numStages , such as 1, 5, 10, 20 and 100, but in all these attempts I get the same error.
I have not tried the different values ββ-minHitRate, -maxFalseAlarmRate, -weightTrimRate, -maxDepth, -maxWeakCount, because I really do not understand how they affect the behavior of the opencv_traincascade algorithm.
Any help is much appreciated :)