koonkie
koonkie

Reputation: 1

Opencv_traincascade numstages is not matching with the parameters

I have made a classifier before and didn't have any issues with the opencv_traincascade. I set the numstage at 10, and should expect training 9-stage. However, it surpasses 10 and got killed at training 16-stage.

I looked at my parameters and noticed that the numstage was 20 instead of 10... as what I have shown below.

May someone explain, what I am doing wrong? Why is the parameters saying numstage 20 when I only wanted 10?

/workspace$ opencv_traincascade -data data -vec p.vec -bg bg2.txt -numPos 250 -numNeg 800 numstages 10 -w 50 -h 150

Training parameters are pre-loaded from the parameter file in data folder! 
Please empty this folder if you want to use a NEW set of training parameters.

PARAMETERS:
cascadeDirName: data
vecFileName: p.vec
bgFileName: bg2.txt
numPos: 250
numNeg: 800
numStages: 20  <-- *******THIS ONE!********
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: HAAR
sampleWidth: 50
sampleHeight: 150
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC

Stages 0-15 are loaded

===== TRAINING 16-stage =====
<BEGIN
POS count : consumed   250 : 260

Upvotes: 0

Views: 278

Answers (1)

Micka
Micka

Reputation: 20130

you missed the "-" before numstages (and maybe capital letter, not sure) so the application uses default value 20

please try

opencv_traincascade -data data -vec p.vec -bg bg2.txt -numPos 250 -numNeg 800 -numStages 10 -w 50 -h 150

Upvotes: 0

Related Questions