Improve Cascade Detection

asked 2014-09-08 09:14:12 -0500

johncordeiro gravatar image

I trained a cascade classifier with de following arguments:

Positive Images: 500 Negative Images: 1440

Samples Creation:

perl bin/createsamples.pl positives negatives samples 1000 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 60 -h 25"

Train Cascade:

opencv_traincascade -data classifier -vec samples.vec -bg negatives -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 500 -numNeg 1440 -w 60 -h 25 -mode ALL -precalcValBufSize 768 -precalcIdxBufSize 768 -mem 3072 -baseFormatSave

I generated de cascade.xml, and I'm detecting in a group of images using OpenCV for Java with:

objectDetector.detectMultiScale(image, objectDetections, 1.2, 1, Objdetect.CASCADE_FIND_BIGGEST_OBJECT | Objdetect.CASCADE_DO_ROUGH_SEARCH, new Size(), new Size());

My main goal is detect if there is or not the cascade classifier in searched images. So, finally my questions:

1 - What am I doing wrong ? 2 - Is there a good way to get the best detection results ?

edit retag flag offensive close merge delete