Training a classifier using images of different dimensions but same number of HoG features

元气小坏坏 提交于 2020-01-04 14:04:06

问题


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

They all fall under the following dimensions:

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

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

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.

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).


回答1:


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?

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.

Edit: 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.

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.



来源:https://stackoverflow.com/questions/24703005/training-a-classifier-using-images-of-different-dimensions-but-same-number-of-ho

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!