不能在traincascade中使用-w -h

时间:2016-06-20 16:32:18

标签: c++ opencv

我对样本traincascade的大小有问题。我使用opencv_traincascade.exe来训练汽车后部。汽车后部的尺寸,我需要有72x48的尺寸。现在我使用createsample使用命令

创建2000个样本大小72x48
D:\Project_Android\Classifier\bin\opencv_createsamples.exe  -info positive.txt -bg negative.txt -vec vector.vec -num 2000 -w 72 -h 48

现在,我有一个矢量文件和negative.txt(肯定negative.txt有背景图像的绝对方向)。我使用opencv_traincascade.exe命令。

D:\Project_Android\Classifier\bin\opencv_traincascade.exe -data HaarTraining -vec vector.vec -bg negative.txt -numPos 250 -numNeg 1500 -numStages 10 -nonsym -minhitrate 0.999 -maxfalsealarm 0.5 -mode ALL -w 72 -h 48 -precalcValBufSize 2046 -precalcIdxBufSize 2046 PAUSE 

我收到错误。

enter image description here

当我使用尺寸24x24(-w 24 -h 24)进行createsample.exe步骤和cascadetraining步骤时,一切正常,运行traincasecade。

它似乎是24x24的大小是样本的默认大小,它仍然存在。我似乎无法在文件.bat中配置它(我在文件bat中编写命令并单击文件bat运行)

我在命令窗口中看到的一件事是:-precalcValBufSize和-precalcIdxBufSize仍然是默认值1024. -w -h -precalcValBufSize -precalcIdxBufSize没有变化。

那么它有什么问题,我不明白为什么我不选择火车样品的大小。我只能使用尺寸24x24,所有尺寸的其他尺寸始终给出错误“断言失败< _img.row * _img.height == vecSize>在CvcascadeImageReader ... pla pla”

请帮我解决这个问题。非常感谢你

0 个答案:

没有答案
相关问题