我有約931個裁剪正樣本和1162個負樣本(非感興趣的對象)。裁剪後的圖像分辨率爲54x12,放置在一個文件夾中。包含正樣本的.txt文件如下所示:picture1.bmp 1 0 0 54 12。我有一個負圖像的.txt文件,其中只包含Noneye001.bmp等負片圖像的名稱。哈爾訓練期間使用TBB使用traincascade.exe時出錯
所用命令: 1.對於.vec文件生成
C:\Opencv2.4.3\opencv\build\bin\Debug\opencv_createsamplesd.exe -info positive/info.txt -num 931 -vec data/vector.vec -maxxangle 0.6 -maxyangle 0 -maxzangle 0.3 -maxidev 100 -bgcolor 0 -bgthresh 0 -w 54 -h 12
2.對於Haartraining
C:\Opencv2.4.3\opencv\build\bin\Debug\opencv_traincascaded.exe -data data/cascade -vec data/vector.vec -bg negative/infofile.txt -numPos 931 -numNeg 1162 -numStages 20 -precalcValBufSize 256 -precalcIdxBufSize 256 -featureType HAAR -mode ALL -w 54 -h 12
我收到以下錯誤
PARAMETERS:
cascadeDirName: data/cascade
vecFileName: data/vector.vec
bgFileName: negative/infofile.txt
numPos: 931
numNeg: 1162
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: HAAR
sampleWidth: 54
sampleHeight: 12
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 931 : 931
NEG count : acceptanceRatio 1162 : 1
Precalculation time: 41.787
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 0.996778| 0.300344|
+----+---------+---------+
END>
===== TRAINING 1-stage =====
<BEGIN
OpenCV Error: Bad argument (Can not get new positive sample. The most possible r
eason is insufficient count of samples in given vec-file.
) in unknown function, file ..\..\..\apps\traincascade\imagestorage.cpp, line 15
9
我試圖增加和減少不。的負面樣本,但沒有幫助。
請幫忙....... 在此先感謝。
謝謝..........減少沒有。的正面樣本工作。 – user2335632 2013-05-02 07:23:42