[英]Troubles on training Haar cascade with LBP
I'm trying to train some branch logos with haar_cascade. 我正在尝试使用haar_cascade训练一些分支徽标。 What I've done is, I've taken 2500 squared pictures of 500 x 500 to populate the samples for opencv_createsamples
. 我要做的是,我已经拍摄了2500张500 x 500的正方形图片,以填充opencv_createsamples
的样本。 Then I generate them as: 然后我将它们生成为:
opencv_createsamples -info 'logo.info' -vec '../logo.vec' -bg '../Negatives/bg.txt' -w 24 -h 24 -num 2500 opencv_createsamples -info'logo.info'-vec'../logo.vec'-bg'../Negatives/bg.txt'-w 24 -h 24 -num 2500
in my logo.info
I've got lines which correspond to the relative path of every picture, with a 1 0 0 500 500
meaning "there's one object between (0,0) and (500, 500)" 在我的logo.info
我有对应于每张图片相对路径的线条,其中1 0 0 500 500
表示“在(0,0)和(500,500)之间存在一个对象”
then I train the cascade as: 然后我将级联训练为:
opencv_traincascade -data 'cascade/' -vec '../logo.vec' -bg '../Negatives/bg.txt' -numPos 2500 -numNeg 3019 -numStages 25 -featureType LBP -w 24 -h 24 opencv_traincascade-数据'cascade /'-vec'../logo.vec'-bg'../Negatives/bg.txt'-numPos 2500 -numNeg 3019 -numStages 25 -featureType LBP -w 24 -h 24
with these parameters: 具有以下参数:
PARAMETERS: 参数:
cascadeDirName: cascade/ CascadeDirName:级联/
vecFileName: ../logo.vec vecFileName:../ logo.vec
bgFileName: ../Negatives/bg.txt bgFileName:../Negatives/bg.txt
numPos: 2500 numPos:2500
numNeg: 3019 数量:3019
numStages: 25 数级:25
precalcValBufSize[Mb] : 256 precalcValBufSize [Mb]:256
precalcIdxBufSize[Mb] : 256 precalcIdxBufSize [Mb]:256
stageType: BOOST stageType:BOOST
featureType: LBP FeatureType:LBP
sampleWidth: 24 sampleWidth:24
sampleHeight: 24 样品高度:24
boostType: GAB boostType:GAB
minHitRate: 0.995 minHitRate:0.995
maxFalseAlarmRate: 0.5 maxFalseAlarmRate:0.5
weightTrimRate: 0.95 重量修剪率:0.95
maxDepth: 1 maxDepth:1
maxWeakCount: 100 maxWeakCount:100
And I've got 2 kind of errors: 而且我有两种错误:
... ...
this errors uses to happen when you don't give a significant difference between your num of images and your -num
parameter. 当您在图片数量和-num
参数之间没有显着差异时,就会发生此错误。 So, let's try to give less 100!! 所以,让我们尝试少给100!
well, when I've adjusted the parameters to not to go out from the array, I get the same type of output than images, but I get this error: 好吧,当我将参数调整为不从数组中取出时,我得到的输出类型与图像相同,但是出现以下错误:
OpenCV Error: Assertion failed (tempNode->left) in write, file /tmp/buildd/opencv-2.3.1/modules/traincascade/boost.cpp, line 628 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/buildd/opencv-2.3.1/modules/traincascade/boost.cpp:628: error: (-215) tempNode->left in function write OpenCV错误:写入时断言失败(tempNode-> left),文件/tmp/buildd/opencv-2.3.1/modules/traincascade/boost.cpp,在抛出'cv :: Exception'实例后调用第628行终止():/tmp/buildd/opencv-2.3.1/modules/traincascade/boost.cpp:628:错误:(-215)tempNode->留在函数写入中
Aborted 中止
I've tried: 我试过了:
-mode
parameter. 更改-mode
参数。 What I have to do, is training obligatory with LBP (not HAAR). 我要做的是必须进行LBP(不是HAAR)的培训。 Do anyone have any clue? 有人有任何线索吗?
Thank you in advance. 先感谢您。
卸载并重建OpenCV解决了该问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.