it's a common error, but i have searched for an answer and try many suggestions, but nothing works. I use opencv 3.1 on my windows (10) system want to train a system for recognition of playmobil figures. i have a bunch of 118 positive images of different playmo figures and i have nearly 3000 negative images. All converted into pgm format. Positive images are 64x128, negative images are sized max. 256x256. (I have he original files, too) I started training with this parameters:
opencv_traincascade.exe -data classifier -vec playmobil.vec -bg negative.txt -numPos 110 -numNeg 1000 -numStages 3 -w 24 -h 48 -minHitRate 0.999 -maxFalseAlarmRate 0.5
0-Stage works like charm, got this as output:
E:\temp\train>..\opencv3\build\x64\vc14\bin\opencv_traincascade.exe -data classifier -vec playmobil.vec -bg negative.txt -numPos 110 -numNeg 1000 -numStages 3 -w 24 -h 48 -minHitRate 0.999 -maxFalseAlarmRate 0.5
PARAMETERS:
cascadeDirName: classifier
vecFileName: playmobil.vec
bgFileName: negative.txt
numPos: 110
numNeg: 1000
numStages: 3
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: HAAR
sampleWidth: 24
sampleHeight: 48
boostType: GAB
minHitRate: 0.999
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 110 : 110
NEG count : acceptanceRatio 1000 : 1
Precalculation time: 20.522
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 0|
+----+---------+---------+
END>
Training until now has taken 0 days 0 hours 1 minutes 32 seconds.
But at 1-stage training stops with the message:
===== TRAINING 1-stage =====
<BEGIN
POS count : consumed 110 : 110
Train dataset for temp stage can not be filled. Branch training terminated.
I have tried many different parameter. With more or less negative images. Nothing works. Any other ideas?