Ask Your Question

Need help pls ! My haartraining is blocked at stage 11

asked 2017-11-06 09:04:50 -0600

classic gravatar image


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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-12-24 05:44:36 -0600

classic gravatar image

I didn't had enough of positive. I had too much of negative compare to my positive number.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-11-06 09:04:31 -0600

Seen: 179 times

Last updated: Dec 24 '17