traincascade - "Cascade classifier can't be trained. Check the used training parameters."
Hi, I'm trying to train simple cascade classifier. I've created vec file with createsamples utility. But when i try to train classifier with command:
C:\ocv_sample> ..\opencv\build\x64\vc10\bin\opencv_traincascade.exe -data data -vec positive\myvec.vec -bg negative\bg.txt -numPos 3 -numNeg 5 -numStages 2 -w 300 -h 50 -featureType LBPI get an error:
PARAMETERS: cascadeDirName: data vecFileName: positive\myvec.vec bgFileName: negative\bg.txt numPos: 3 numNeg: 5 numStages: 2 precalcValBufSize[Mb] : 256 precalcIdxBufSize[Mb] : 256 stageType: BOOST featureType: LBP sampleWidth: 300 sampleHeight: 50 boostType: GAB minHitRate: 0.995 maxFalseAlarmRate: 0.5 weightTrimRate: 0.95 maxDepth: 1 maxWeakCount: 100 ===== TRAINING 0-stage ===== BEGIN POS count : consumed 3 : 3 NEG count : acceptanceRatio 5 : 1 Precalculation time: 2.05 +----+---------+---------+ | N | HR | FA | +----+---------+---------+ END Cascade classifier can't be trained. Check the used training parameters.My directory structure looks like:
\data \negative bg.txt \img 1.jpg 2.jpg 3.jpg 4.jpg 5.jpg \positive myvec.vec
bg.txt:
img/1.jpg img/2.jpg img/3.jpg img/4.jpg img/5.jpg
I use Win7. What am i doing wrong?
Basically I am guessing you have not enough data after the first stage. You always need more positive data then actually supplied to the positive parameter. Frequently people use like 85% - 90% of their data. About 3 pos and 5 neg, that will never give any decent results... You will need at least 50 pos and 250 neg to get something to work.
Also search this forum first using the search button at the start page! Give tags like traincascade and you will see tons of questions handling your problems...