我有大约 931 个裁剪的正样本和 1162 个负样本(非感兴趣对象)。裁剪后的图像分辨率为 54x12,并放置在文件夹中。包含阳性样本的 .txt 文件如下所示:picture1.bmp 1 0 0 54 12。我有一个负图像的 .txt 文件,其中仅包含负图像的名称,例如 Noneye001.bmp。
使用的命令: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.用于训练
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
我尝试增加和减少没有。负样本,但它没有帮助。
请帮忙.......提前谢谢。