Ask Your Question

Revision history [back]

Train Cascade parameters calculations issue

I am temphasized textraining a cascade classifier using opencv. I have 56 positive and 120 negative samples. Their dimensions are 40 * 50 pixels.

The code that I used to make the samples was:

 E:\openCV\opencv\build\x64\vc12\bin\opencv_createsamples.exe -info pos.txt -vec SAMP.vec -num 56 -w 40 -h 50

and the traning code is :

E:\openCV\opencv\build\x64\vc12\bin\opencv_traincascade.exe -data classifier -vec SAMP.vec -bg neg.txt -featureType HAAR -numStages 12 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 40 -numNeg 120 -w 40 -h 50 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024

The training is showing this message:

image description

===== TRAINING 4-stage =====

BEGIN

POS count : consumed 40 : 45


and no matter how long i wait, nothing happens.

1. Is there any problem in my code?

2. Does this equation has any thing to do in my code :

vec-file has to contain >= (numPose + (numStages-1) * (1 - minHitRate) * numPose) + S ??

I still cant figure out the S, what it really means? how to calculate the S?

Train Cascade parameters calculations issue

I am temphasized textraining training a cascade classifier using opencv. I have 56 positive and 120 negative samples. Their dimensions are 40 * 50 pixels.

The code that I used to make the samples was:

 E:\openCV\opencv\build\x64\vc12\bin\opencv_createsamples.exe -info pos.txt -vec SAMP.vec -num 56 -w 40 -h 50

and the traning code is :

E:\openCV\opencv\build\x64\vc12\bin\opencv_traincascade.exe -data classifier -vec SAMP.vec -bg neg.txt -featureType HAAR -numStages 12 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 40 -numNeg 120 -w 40 -h 50 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024

The training is showing this message:

image description

===== TRAINING 4-stage =====

BEGIN

POS count : consumed 40 : 45


and no matter how long i wait, nothing happens.

1. Is there any problem in my code?

2. Does this equation has any thing to do in my code :

vec-file has to contain >= (numPose + (numStages-1) * (1 - minHitRate) * numPose) + S ??

I still cant figure out the S, what it really means? how to calculate the S?