使用不同尺寸但具有相同数量的HoG特征的图像训练分类器 [英] Training a classifier using images of different dimensions but same number of HoG features

查看:364
本文介绍了使用不同尺寸但具有相同数量的HoG特征的图像训练分类器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用一些图像训练我的分类器,其中一些图像具有不同的尺寸。

I want to train my classifier with some images, some of which have different dimensions.

它们都属于以下尺寸:


  • 100x50

  • 50x100

  • 64x72

  • 72x64

  • 100x50
  • 50x100
  • 64x72
  • 72x64

然而,9个方向箱和每个单元8个像素,每个都会产生648个HoG功能。

However, with 9 orientation bins, and 8 pixels per cell, each of these generates 648 HoG features.

我实际上选择的所有图像都是这些尺寸之一,这样他们最终会拥有相同数量的HoG功能,以便训练统一。

I actually chose all images to be of one of these sizes so that they would end up having the same number of HoG features so that training is uniform.

我选择这个的原因是因为训练图像中感兴趣的对象有时会有不同的宽高比,因此裁剪出一些相同大小的所有图像图像在那里留下太多背景。

The reason I opted for this is because the object of interest in the training images sometimes has a different aspect ratio, hence cropping all the images the same size for some of the images left too much background in there.

现在我的问题是 - 训练图像的宽高比/图像尺寸是多少,只要数量为HoG功能是否一致? (我的训练算法只接受HoG功能)。

Now my question is - does it matter what the aspect ratio/image dimensions of the training images are, as long as the number of HoG features is consistent? (My training algorithm only takes in the HoG features).

推荐答案

如果您的HOG功能全部使用8x8细胞,那么你怎么能为不同大小的图像获取相同大小的矢量?你不能在更大的图像中有更多的单元格吗?

If your HOG features all use 8x8 cells, then how can you get the same size vector for different size image? Wouldn't you have more cells in a larger image?

通常,如果你想使用HOG,你应该将所有图像的大小调整为相同的大小。

Generally, if you want to use HOG, you should resize all images to be the same size.

另一个问题:您是否只想对已经裁剪过的图像进行分类,还是想要检测大型场景中的对象?如果您只想分类,那么宽高比的变化可能是个问题。另一方面,如果要进行滑动窗口对象检测,则纵横比的变化是一个更大的问题。您可能必须根据纵横比将类别划分为子类,并为每个类别训练单独的检测器。

Another question: do you just want to classify the images that are already cropped, or do you want to detect objects in a large scene? If you just want to classify, then the variation in the aspect ratio may be a problem. On the other hand, if you want to do sliding-window object detection, the variation in the aspect ration is a much bigger problem. You may have to break your category into sub-classes based on the aspect ratio, and train a separate detector for each one.

编辑:
很抱歉,但是通过使用舍入误差和宽高比的差异来获得相同长度的HOG矢量是作弊。 :)重点是让HOG单元格编码空间信息。相应的单元必须在不同的图像中编码相同的点。否则你正在比较苹果和橘子。

Sorry, but getting the HOG vectors to be the same length by using roundoff errors and differences in aspect ratio is cheating. :) The whole point is to have the HOG cells encode spatial information. The corresponding cells must encode the same spot in different images. Otherwise you are comparing apples and oranges.

就物体检测而言,纵横比是最重要的。您将在图像上滑动一个窗口,该窗口最好具有与您要检测的对象相同的纵横比。否则,它根本行不通。因此,如果您有这4种不同的宽高比,最好的办法是训练4种不同的探测器。

As far as object detection, aspect ratio is paramount. You would be sliding a window over the image, and that window had better have the same aspect ratio as the objects you are trying to detect. Otherwise, it simply won't work. So if you have these 4 distinct aspect ratios, your best bet is to train 4 different detectors.

这篇关于使用不同尺寸但具有相同数量的HoG特征的图像训练分类器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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