Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 LBP
I 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?