Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem with Cascade Classifier

I've problems with the Cascade Classifer. I created 5000 positive samples like this: image description

with this command:

C:\OpenCV31\opencv\build\x64\vc14\bin\opencv_createsamples.exe -img C:\CreateSamples\test\image6.jpg -vec gew.vec -bg neg.txt -num 5000 -w 80 -h 80 -show -maxyangle 0.0 -maxzangle 0.0 -maxxangle 0.5 -bgcolor 0

then i trained a classifier like this:

C:\OpenCV31\opencv\build\x64\vc14\bin\opencv_traincascade.exe -data NEWclassifier -vec gew.vec -bg neg.txt -numStages 15 -numPos 2500 -numNeg 1500 -w 80 -h 80 -precalcValBufSize 4048 -precalcIdxBufSize 4048 -featureType LBP

and get this result:

image description

The Problem is: it detects nearly everything as an object:

I used this image: image description

and get this:

image description

I'm new with Cascade Classifier and read a lot of tutorials and samples, but i don't get my mistake. Can you help me?

Problem with Cascade Classifier

I've problems with the Cascade Classifer. I created 5000 positive samples like this: image description

with this command:

C:\OpenCV31\opencv\build\x64\vc14\bin\opencv_createsamples.exe -img C:\CreateSamples\test\image6.jpg -vec gew.vec -bg neg.txt -num 5000 -w 80 -h 80 -show -maxyangle 0.0 -maxzangle 0.0 -maxxangle 0.5 -bgcolor 0

then i trained a classifier like this:

C:\OpenCV31\opencv\build\x64\vc14\bin\opencv_traincascade.exe -data NEWclassifier -vec gew.vec -bg neg.txt -numStages 15 -numPos 2500 -numNeg 1500 -w 80 -h 80 -precalcValBufSize 4048 -precalcIdxBufSize 4048 -featureType LBP

and get this result:

image description

The Problem is: it detects nearly everything as an object:

I used this image: image description

and get this:

image description

I'm new with Cascade Classifier and read a lot of tutorials and samples, but i don't get my mistake. Can you help me?

I call detectMultiscale like this: face_cascade.detectMultiScale(frame_gray, faces, 1.1, 0, 0, cv::Size(10, 10));