HaarTraining与OpenCV错误 [英] HaarTraining with OpenCV error

查看:251
本文介绍了HaarTraining与OpenCV错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大约15000个带有感兴趣对象(正样本)和7000个负像(非感兴趣对象)的裁剪图像。裁剪后的图像分辨率为48x96,并放在一个文件夹中。包含正样本的.txt文件看起来像这样:picture1.pgm 1 0 0 48 96意味着图片1中有1个正样本从(0,0)到(48,96)。同样,我有一个负片图像的.txt文件。

I have about 15000 cropped images with the object of interest (positive samples) and 7000 negative images (non object of interest). The cropped images have a resolution of 48x96 and are placed in a folder. The .txt file containing the positive samples looks something like this : picture1.pgm 1 0 0 48 96 meaning that there is 1 positive sample in picture 1 from (0,0) to (48, 96). Likewise I have a .txt file for negative images.

培训命令如下:
c:\libraries \\ \\ OpenCV2.4.1\opencv\built\bin\Debug> opencv_haartrainingd.exe -data d
ata / cascade -vec data / positives.vec -bg c:/ users / gheorghi / desktop / daimler / pedest
rian_stereo_extracted / nonpedestrian / nonpedestrian / c0 / negatives.txt -npos 15660 -
nneg 7129 -ststage 14 -mem 1000 -mode ALL -w 18 -h 36 -nonsym

但在某些时候我总是会收到此错误:

But at some point I always get this error :

    Parent node: 0

*** 1 cluster ***
OpenCV Error: Assertion failed (elements_read == 1) in unknown function, file C:
\libraries\OpenCV2.4.1\opencv\apps\haartraining\cvhaartraining.cpp, line 1858

如何我可以克服这个???任何帮助表示赞赏。非常感谢

How can I overcome this ??? Any help is appreciated. Many many thanks

推荐答案

我发现问题可以通过两种方式解决。你可以减少积极数量或增加负面数量。无论哪种方式,事实证明,正负比率有所帮助。

I found that the problem can be solved in 2 ways. you can either decrease the amount of positives or increase the amount of negatives. either way it turns out that having a small positive to negative ratio helps.

这篇关于HaarTraining与OpenCV错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆