OpenCV错误"无法填充临时阶段的训练数据集。分支培训终止。"在开始训练阶段-3之后

时间:2015-01-16 02:53:45

标签: opencv ocr

在搜索此错误时,我只发现了一开始就发生的情况。就我而言,它发生在三阶段训练的开始阶段。

我正在使用OpenCV 2.4.10,启用了OpenMP。 Bellow是我使用的命令行和输出。有谁知道如何解决这个问题?

root@6b0f88eaadb9:/opt/ocr-samples3/train-detector# opencv_traincascade -data ./out// -vec ./positive/vecfile.vec -bg ./negative/negative.txt -w 247 -h 80 -numPos 78 -numNeg 1325 -featureType LBP -numStages 8
libdc1394 error: Failed to initialize libdc1394
Training parameters are loaded from the parameter file in data folder!
Please empty the data folder if you want to use your own set of parameters.
PARAMETERS:
cascadeDirName: ./out//
vecFileName: ./positive/vecfile.vec
bgFileName: ./negative/negative.txt
numPos: 78
numNeg: 1325
numStages: 8
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: LBP
sampleWidth: 247
sampleHeight: 80
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   78 : 78
NEG count : acceptanceRatio    1325 : 1
Precalculation time: 6
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|0.0211321|
+----+---------+---------+
END>
Training until now has taken 0 days 1 hours 22 minutes 40 seconds.

===== TRAINING 1-stage =====
<BEGIN
POS count : consumed   78 : 78
NEG count : acceptanceRatio    1325 : 0.0928456
Precalculation time: 10
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|        1|0.0324528|
+----+---------+---------+
END>
Training until now has taken 0 days 3 hours 19 minutes 57 seconds.

===== TRAINING 2-stage =====
<BEGIN
POS count : consumed   78 : 78
NEG count : acceptanceRatio    1325 : 0.00679104
Precalculation time: 7
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|     0.08|
+----+---------+---------+
END>
Training until now has taken 0 days 4 hours 38 minutes 25 seconds.

===== TRAINING 3-stage =====
<BEGIN
POS count : consumed   78 : 78
Train dataset for temp stage can not be filled. Branch training terminated.

1 个答案:

答案 0 :(得分:0)

你有多大的负面形象。我有同样的问题。错误说他没有足够的负面图像。您的负面图像不一定与您的正面图像相同。所以我所做的就是拍摄原始的负像,但是对象上有一个黑色的矩形。然后重新开始。

在图像中对新的负片图像进行负片搜索,当他使用一张负像时,他不再使用它。它是随机选择的,与你的正面图像大小相同。