Ask Your Question
0

opencv_traincascade error: Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.

asked 2015-08-25 07:11:59 -0600

updated 2015-08-25 07:16:14 -0600

berak gravatar image

Bat file contain:

C:\opencv\build\x86\vc11\bin\opencv_traincascade.exe -data classifier -vec samples1.vec -bg negative.txt -numPos 10 -numNeg 100 -numStages 3 -precalcValBufSize 256 -precalcIdxBufSize 256 -baseFormatSave -w 20 -h 20 -mode ALL 
PAUSE

After run the bat file I am getting error.

C:\TEST_IMAGE\training>C:\opencv\build\x86\vc11\bin\opencv_traincascade.exe -dat
a classifier -vec samples1.vec -bg negative.txt -numPos 10 -numNeg 100 -numStage
s 10 -precalcValBufSize 256 -precalcIdxBufSize 256 -baseFormatSave -w 20 -h 20 -
mode ALL
PARAMETERS:
cascadeDirName: classifier
vecFileName: samples1.vec
bgFileName: negative.txt
numPos: 10
numNeg: 100
numStages: 10
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: HAAR
sampleWidth: 20
sampleHeight: 20
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   10 : 10
Train dataset for temp stage can not be filled. Branch training terminated.
Cascade classifier can't be trained. Check the used training parameters.

How to solve the error??

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-08-25 07:20:14 -0600

berak gravatar image

updated 2015-08-25 07:29:22 -0600

you need far more than 10 positive images. 1000 would be good. ;)

look at this line:

POS count : consumed   10 : 10

they were all used up in the 1st stage, now there are no more left for the next stages.

also, you even need to have more than 'numPos' positive images, because it might find some of them not useful at all.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-08-25 07:11:59 -0600

Seen: 860 times

Last updated: Aug 25 '15