Train cascade classifier train error

asked 2015-08-21 15:22:48 -0600

Precious Roy gravatar image

updated 2015-08-21 15:47:37 -0600

Hello,

I am currently having problems training my own classifier.

I have created :

Negative.txt Positive.vec I can open and view my vec file just fine.

and start training with opencv_traincascade.exe -data "data/" -vec Positive.vec -bg negative.txt -numPos 1987 -numNeg 3000 -numStages 30 -w 55 -h 55 -featureType LBP

when i start the training it does the first stage just fine but when it gets to the second one i get

===== TRAINING 1-stage ===== BEGIN OpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of
samples in given vec-file. ) in CvCascadeImageReader::PosReader::get, file C:\builds\master_PackSlave-win32-vc12-
shared\opencv\apps\traincascade\imagestorage.cpp, line 157

can any one tell me why i am getting this error

Edit: Output:

opencv_createsamples.exe -info Positive.info -num 1988 -w 55 -h 55 -vec Positive.vec -num 1988
Info file name: Positive.info
Img file name: (NULL)
Vec file name: Positive.vec
BG  file name: (NULL)
Num: 1988
BG color: 0
BG threshold: 80
Invert: FALSE
Max intensity deviation: 40
Max x angle: 1.1
Max y angle: 1.1
Max z angle: 0.5
Show samples: FALSE
Width: 55
Height: 55
Create training samples from images collection...
Positive.info(1988) : parse errorDone. Created 1987 samples

output 2

opencv_traincascade.exe -data "data/" -vec Positive.vec -bg negative.txt -numPos 1987 -numNeg 3000 -        
numStages 2 -w 55 -h 55 -featureType LBP
PARAMETERS:
cascadeDirName: data/
vecFileName: Positive.vec
bgFileName: negative.txt
numPos: 1987
numNeg: 3000
numStages: 2
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: LBP
sampleWidth: 55
sampleHeight: 55
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
BEGIN
POS count : consumed   1987 : 1987
NEG count : acceptanceRatio    3000 : 1
Precalculation time: 9.501
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2| 0.996477|0.0776667|
+----+---------+---------+
END>
Training until now has taken 0 days 0 hours 4 minutes 8 seconds.

===== TRAINING 1-stage =====
BEGIN
OpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of     
samples in given vec-file.
) in CvCascadeImageReader::PosReader::get, file C:\builds\master_PackSlave-win32-vc12-    
shared\opencv\apps\traincascade\imagestorage.cpp, line 157
edit retag flag offensive close merge delete