简体   繁体   English

Haar分类器正面图像集说明

[英]Haar Classifier positive image set clarification

Could you please help understand several points related to Haar Classifier training: 您能否帮助理解与Haar分类器培训有关的几点:

1) Should positive image contain only the training object or they can contain some other objects in it? 1)正像应该只包含训练对象还是它们可以包含其他一些对象? Like I want to recognize some traffic sign, should the positive image contain only traffic sign or it can contain highway also? 就像我想识别一些交通标志一样,正像应该只包含交通标志还是也可以包含高速公路?
2) There are 2 ways of creating samples vector file, one is using info file, which contains the detected object coordinates in positive image, another just giving the list of positives and negatives. 2)有两种创建样本矢量文件的方法,一种是使用信息文件,其中包含在正图像中检测到的对象坐标,另一种仅给出正负列表。 Which one is better? 哪一个更好?
3) How usually you create info file, which contains the detected object coordinates in positive image? 3)通常如何创建信息文件,该文件包含正图像中检测到的对象坐标? Can image clipper generate object cordinates? 图像裁剪器可以生成对象坐标吗?

And does dlib histogram of adaptive gradient provides better results than Haar classifier? 自适应梯度的dlib直方图是否比Haar分类器提供更好的结果?
My target is traffic sign detection in raspberry pi. 我的目标是在树莓派中检测交通标志。

Thanks 谢谢

the positive sample (not necessarily the image) should contain only the object. 阳性样本(不一定是图像)应仅包含对象。 Sometimes it is not possible to get the right aspect ratio for each positive sample, then you would either add some background or crop some of the object boundary. 有时,不可能为每个阳性样本获得正确的宽高比,然后您将添加一些背景或裁剪一些对象边界。 The final detector will detect regions of your positive sample aspect ratio, so if you use a lot of background around all of your positive samples, your final detector will probably not detect a region of your traffix sign, but a region with a lot of background around your traffic sign. 最终检测器将检测正样本宽高比的区域,因此,如果在所有正样本周围使用大量背景,则最终检测器可能不会检测到Traffix符号的区域,而会检测到具有许多背景的区域在您的交通标志周围。

Afaik, the positive samples must be provided by a .vec file which is created with opencv_createsamples.exe and you'll need a file with the description (where in the images are your positive samples?). Afaik,阳性样品必须由使用opencv_createsamples.exe创建的.vec文件提供,您将需要一个带有说明的文件(图像中的阳性样品在哪里?)。 I typically go the way that I preprocess my labeled training samples, crop away all the background, so that there are only intermediate images where the positive sample fills the whole image and the image is already the right aspect ratio. 我通常采用预处理标签训练样本的方式,裁剪掉所有背景,以便只有中间图像,其中正样本填充整个图像,并且该图像已经是正确的宽高比。 I fill a text file with basically "folder/filename.png 0 0 width height" for each of those intermediate images and then create a .vec file from that intermediate images. 我为每个中间图像填充一个基本上具有“ folder / filename.png 0 0 width height”的文本文件,然后从该中间图像创建一个.vec文件。 But the other way, using a real roi information out of full-size images should be of same quality. 但是另一种方法是,从全尺寸图像中使用真实的roi信息应具有相同的质量。

Be aware that if you don't fix the same aspect ratio for each positive sample, you'll stretch your objects, which might or might not be a problem in your task. 请注意,如果不为每个正样本固定相同的宽高比,则会拉伸对象,这可能会或可能不会成为您的任务中的问题。

And keep in mind, that you can create additional positive samples from warping/transforming your images. 请记住,您可以通过变形/变换图像来创建其他正样本。 opencv_createsamples can do that for you, but I never really used it, so I'm not sure whether training will benefit from using such samples. opencv_createsamples可以为您做到这一点,但是我从未真正使用过它,因此我不确定使用这样的示例是否会使培训受益。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM