OpenCV 2.4.13级联分类器训练问题

时间:2016-06-20 16:21:45

标签: c++ opencv haar-classifier

我尝试使用以下方法训练haar级联:

C:\opencv\build\x86\vc12\bin\opencv_traincascade.exe -data C:\opencv\build\x86\vc12\bin\LETTER_TRAIN -vec C:\opencv\build\x86\vc12\bin\LETTER.vec -bg C:\opencv\build\x86\vc12\bin\LETTER_NEG.dat -numPos 4 -numNeg 28 -numStages 15 -minHitRate 0.995 -w 50 -h 50 -featureType LBP -precalcValBufSize 1024 -precalcldxBufSize 1024

当我在命令提示符中发送它时,我得到:

 PARAMETERS:
cascadeDirName: C:\opencv\build\x86\vc12\bin\LETTER_TRAIN
vecFileName: C:\opencv\build\x86\vc12\bin\LETTERS.vec
bgFileName: C:\opencv\build\x86\vc12\bin\LETTER_NEG.dat
numPos: 13
numNeg: 28
numStages: 2
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: LBP
sampleWidth: 50
sampleHeight: 50
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
Number of unique features given windowSize [50,50] : 166464

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

我尝试使用this解决问题,但没有用。

负片图像文件(.dat)是:

\LETTERS_NEG(bg)\Untitled.jpg
\LETTERS_NEG(bg)\Untitled2.jpg
\LETTERS_NEG(bg)\Untitled3.jpg
\LETTERS_NEG(bg)\Untitled4.jpg
\LETTERS_NEG(bg)\Untitled5.jpg
\LETTERS_NEG(bg)\Untitled6.jpg
\LETTERS_NEG(bg)\Untitled7.jpg
\LETTERS_NEG(bg)\Untitled8.jpg
\LETTERS_NEG(bg)\Untitled9.jpg
\LETTERS_NEG(bg)\Untitled10.jpg
\LETTERS_NEG(bg)\Untitled11.jpg
\LETTERS_NEG(bg)\Untitled12.jpg
\LETTERS_NEG(bg)\Untitled13.jpg
\LETTERS_NEG(bg)\Untitled14.jpg
\LETTERS_NEG(bg)\Untitled15.jpg
\LETTERS_NEG(bg)\Untitled16.jpg
\LETTERS_NEG(bg)\Untitled17.jpg
\LETTERS_NEG(bg)\Untitled18.jpg
\LETTERS_NEG(bg)\Untitled19.jpg
\LETTERS_NEG(bg)\Untitled20.jpg
\LETTERS_NEG(bg)\Untitled21.jpg
\LETTERS_NEG(bg)\Untitled22.jpg
\LETTERS_NEG(bg)\Untitled23.jpg
\LETTERS_NEG(bg)\Untitled24.jpg
\LETTERS_NEG(bg)\Untitled25.jpg
\LETTERS_NEG(bg)\Untitled26.jpg
\LETTERS_NEG(bg)\Untitled27.jpg
\LETTERS_NEG(bg)\Untitled28.jpg
\LETTERS_NEG(bg)\Untitled29.jpg
\LETTERS_NEG(bg)\Untitled30.jpg

我做错了什么?

0 个答案:

没有答案