Ask Your Question

Revision history [back]

Cannot detect cars

I am trying to create my own cascade to detect cars. I have 2000 negative images. By using following command i am creating samples:

opencv_createsamples -img positive_images/1_car.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1000

Then vec file is created with following command:

opencv_createsamples -info info/info.lst -num 1000 -w 20 -h 20 -vec positives.vec

And then:

opencv_traincascade -data data -vec positives.vec -bg bg.txt -numPos 1000 -numNeg 2000 -numStages 10 -w 20 -h 20

After the cascade is created, the results are very bad. I mean there are only false positives. But when i detect the samples created above in info folder, it detects that object and very low number of false positives are detected.

I also tried using opencv_annotation tool. I downloaded around 8000 positive images and created 400 samples using this tool. But the results are same. I mean i don't know what to do now.

What am i doing wrong?

Is it the number of samples?

Is it width or height?

Please suggest a solution.