Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Need help pls ! My haartraing is blocked at stage 11


I'm new with opencv and I have a problem that I don't understand.

I'm trying to generate a haarcascade to detect big truck on the road but the generating is blocked at stage 11 during the collect of negative/sample.

I Gathered 2015 positives and 6970 negatives. The size of the positives and negatives is 32 x 32.

So I used the folowing command lines on ubuntu was :

create text files for positives and negatives :

find ./negative_images -iname ".jpg" > negatives.txt find ./positive_images -iname ".jpg" > positives.txt

**I created 3500 samples (32 x 32) and maximum size because all of my pictures are 32 x 32 : perl bin/ positives.txt negatives.txt samples 3500 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 32 -w 32 -h 32"

I merged all .vec files : python ./tools/ -v samples/ -o samples.vec

And then I trained my haar cascade with 20 stage : opencv_traincascade -data haar -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 2015 -numNeg 6970 -w 32 -h 32 -mode ALL -precalcValBufSize 256 -precalcIdxBufSize 256

If someone could help me to find out why the the opencv_traincascade is blocked at stage 11 it will be very grateful.

ps : I used this tools I used the opencv 3.2.0 version