我正在使用opencv_traincascade进行对象检测。我试图在照片上找到眼镜。为此,我已经下载了830张照片,如下所示: http://pi1.lmcdn.ru/product/V/I/VI060DWIHZ27_1_v2.jpg计算1天后的OpenCV异常
然后我下载了许多带有模型的照片或照片,1799张照片。
然后我已经开始opencv_traincascade与参数: opencv_traincascade -data功能/分类-vec samples.vec -bg negatives.txt -numStages 10 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 830 -numNeg 1799 -w 60 -h 90 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024
但是在步骤4之后,我收到一条消息: 无法填充临时舞台的列车数据集。分支培训已终止。
完整的堆栈跟踪是:
➜ pictureFeature opencv_traincascade -data Feature/classifier -vec samples.vec -bg negatives.txt -numStages 10 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 830 -numNeg 1799 -w 60 -h 90 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024
PARAMETERS:
cascadeDirName: Feature/classifier
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 830
numNeg: 1799
numStages: 10
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: HAAR
sampleWidth: 60
sampleHeight: 90
boostType: GAB
minHitRate: 0.999
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 830 : 830
NEG count : acceptanceRatio 1799 : 1
Precalculation time: 26
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1| 0.145636|
+----+---------+---------+
END>
Training until now has taken 0 days 5 hours 22 minutes 10 seconds.
===== TRAINING 1-stage =====
<BEGIN
POS count : consumed 830 : 830
NEG count : acceptanceRatio 1799 : 0.145715
Precalculation time: 24
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1| 1|
+----+---------+---------+
| 4| 1| 0.762646|
+----+---------+---------+
| 5| 1| 0.432462|
+----+---------+---------+
END>
Training until now has taken 0 days 14 hours 38 minutes 28 seconds.
===== TRAINING 2-stage =====
<BEGIN
POS count : consumed 830 : 830
NEG count : acceptanceRatio 1799 : 0.062696
Precalculation time: 28
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1| 1|
+----+---------+---------+
| 4| 1| 0.590328|
+----+---------+---------+
| 5| 1| 0.187326|
+----+---------+---------+
END>
Training until now has taken 0 days 23 hours 21 minutes 4 seconds.
===== TRAINING 3-stage =====
<BEGIN
POS count : consumed 830 : 830
NEG count : acceptanceRatio 1799 : 0.0117929
Precalculation time: 21
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1|0.0944969|
+----+---------+---------+
END>
Training until now has taken 1 days 3 hours 47 minutes 34 seconds.
===== TRAINING 4-stage =====
<BEGIN
POS count : consumed 830 : 830
NEG count : acceptanceRatio 1799 : 0.00112161
Precalculation time: 18
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 0|
+----+---------+---------+
END>
Training until now has taken 1 days 5 hours 4 minutes 35 seconds.
===== TRAINING 5-stage =====
<BEGIN
POS count : consumed 830 : 830
Train dataset for temp stage can not be filled. Branch training terminated.
我试图使用对象的搜索cascade.xml,但结果却是完全失败。
有人能与我的问题帮助吗?
要进行分类,你需要收集正面和负面的训练图像(正:头+墨镜和负:头只)在你的IMG样品上只有太阳镜的图像 –
bg.txt是否在Windows上生成? –