简体   繁体   English

创建Haar级联XML-不同大小

[英]creating Haar cascade XML - different sizes

As I understood in order to generate XML, we gotta gather negative and positive images. 据我了解,为了生成XML,我们必须收集负片和正片图像。 In every tutorial I read/saw, all images; 在我阅读/看到的每个教程中,所有图像; positive or negative, are resized to the same size, where the negative is usually double the size of the positive. 正值或负值将调整为相同的大小,其中负值通常是正值的两倍。

My question is as follow; 我的问题如下。 can I have different sizes for positive images? 正面图像可以有不同尺寸吗? I know it is going to be tedious since you need to specify the size of each image every time. 我知道这将很乏味,因为您每次都需要指定每个图像的大小。 But is it possible? 但是有可能吗? Or would the detection of the object fail? 还是检测对象失败?

Imagine I am detecting an object, lets say a bed. 想象一下我正在检测物体,可以说是一张床。 A bed can be single or double, king size, queen size , .. etc. You got my point. 一张床可以是单人或双人,特大号,大号等等。您明白我的意思了。 So is it better to create a different XML for each of these sizes? 那么为这些大小中的每一个创建不同的XML更好吗? Or I can put them in one positive directory and adjust the parameters accordingly to the size? 或者我可以将它们放在一个肯定的目录中,然后根据大小调整参数?

Reasons I am using Haar Cascade features is that it is fast and I need the detection to be done later on in real-time on Raspberry. 我使用Haar Cascade功能的原因是它运行速度快,我需要稍后在Raspberry上实时进行检测。 If there any other way, I am open to any other suggestion too. 如果有其他方法,我也欢迎其他建议。

Thanks! 谢谢!

Yes it is possible to have different sizes for positive images and you are right its a very tedious task but what you see in all the tutorials they will just tell to keep all the images in a same size because it takes a lot of time to specify all the different sizes for each images so they try to keep the code simple and clean but if want to try out with different sizes u can do it but before doing it first try it out with the a same size then if it works then only try with the different sizes. 是的,可能有不同大小的正片图像,这是非常繁琐的工作,但是在所有教程中您会看到,它们只是告诉您将所有图像保持为相同大小,因为要花大量时间指定每个图像的所有大小都不同,因此他们尝试保持代码简单整洁,但是如果要尝试使用不同的大小,则可以这样做,但是在执行此操作之前,请先以相同的大小尝试一下,然后再试一次,然后再尝试与不同的大小。 blindly don't try it make sure you are on the right way. 不要盲目尝试,以确保您走对路。

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

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