首页 文章

与LBP一起训练Haar级联的麻烦

提问于
浏览
0

我已经完成了,我已经拍摄了500 x 500的2500平方图片来填充样本 opencv_createsamples . 然后我生成它们:

opencv_createsamples -info'logo.info'-vec'../ logo.vec'-bg'../Negatives / bg.txt'-w 24 -h 24 -num 2500

在我的 logo.info 中我有相应于每张图片相对路径的线条, 1 0 0 500 500 含义为"there's one object between (0,0) and (500, 500)"

然后我训练级联为:

opencv_traincascade -data'cascade /'-vec'../ logo.vec'-bg'../Negatives / bg.txt'-numPos 2500 -numNeg 3019 -numStages 25 -featureType LBP -w 24 -h 24

使用这些参数:

PARAMETERS:cascadeDirName:cascade / vecFileName:../ logo.vec bgFileName:../ Negatives / bg.txt numPos:2500 numNeg:3019 numStages:25 precalcValBufSize [Mb]:256 precalcIdxBufSize [Mb]:256 stageType:BOOST featureType :LBP sampleWidth:24 sampleHeight:24 boostType:GAB minHitRate:0.995 maxFalseAlarmRate:0.5 weightTrimRate:0.95 maxDepth:1 maxWeakCount:100

我有两种错误:

  • OpenCV错误:参数之一' values is out of range (No components/input_variables is selected!) in cvPreprocessIndexArray, file /tmp/buildd/opencv-2.3.1/modules/ml/src/inner_functions.cpp, line 432 terminate called after throwing an instance of ' cv ::异常'what():/ tmp / buildd / opencv-2.3.1 / modules / ml / src / inner_functions.cpp:432:错误:( - 211)没有组件/ input_variables被选中了!在函数cvPreprocessIndexArray中

enter image description here

...

enter image description here

如果您的图像数量与 -num 参数之间没有显着差异,则会发生此错误 . 所以,让我们试着减少100!

好吧,当我调整参数不要从数组中输出时,我得到的输出类型与图像相同,但是我得到了这个错误:

OpenCV错误:写入中的断言失败(tempNode-> left),文件/tmp/buildd/opencv-2.3.1/modules/traincascade/boost.cpp,第628行终止在抛出'cv :: Exception'的实例后被调用what():/ tmp/buildd/opencv-2.3.1/modules/traincascade/boost.cpp:628:错误:(-215)tempNode->函数写入中止

我试过了:

  • 更改图像的命运大小(24x24,36x36 ......)

  • 更改 -mode 参数 .

  • 尝试放置#positiveSamples <#negativeSamples和#positiveSamples> #negativeSamples

我必须做的是训练必须使用LBP(不是HAAR) . 有人有任何线索吗?

先感谢您 .

1 回答

  • 0

    卸载和重建OpenCV解决了这个问题 .

相关问题