选择/规范化HoG参数以进行对象检测? [英] Choosing/Normalizing HoG parameters for object detection?

查看:383
本文介绍了选择/规范化HoG参数以进行对象检测?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用HoG功能通过分类进行对象检测。

I'm using HoG features for object detection via classification.

我很困惑如何处理不同长度的HoG特征向量。

I'm confused about how to deal with HoG feature vectors of different lengths.

我使用训练图像训练了我的分类器,所有图像都具有相同的大小。

I've trained my classifier using training images that all have the same size.

现在,我的图像上运行分类器 - 说,使用滑动窗口方法。我提取的一些窗口比分类器训练的图像的大小更大。 (它是在可能在测试图像中预期的对象的最小可能的大小上训练的)。

Now, I'm extracting regions from my image on which to run the classifier - say, using the sliding windows approach. Some of the windows that I extract are a lot bigger than the size of images the classifier was trained on. (It was trained on the smallest possible size of the object that might be expected in test images).

问题是,当我需要分类的窗口大于训练图像大小,那么HoG特征向量也比训练模型的特征向量大得多。

The problem is, when the windows I need to classify are bigger than the training image sizes, then the HoG feature vector is also much bigger than the trained model's feature vector.

那么如何使用模型的特征向量来分类提取窗口?

So how can I use the model's feature vector to classify the extract window?

例如,让我们看一个提取的窗口的尺寸,即360x240,并调用 extractedwindow 。然后让我们拍摄一张我的训练图片(只有20x30),并将其命名为 trainingsample

For example, let's take the dimensions of one extracted window, which is 360x240, and call it extractedwindow. Then let's take one of my training images, which is only 20x30, and call it trainingsample.

HoG特征向量,如下:

If I take the HoG feature vectors, like this:

fd1, hog_image1 = hog(extractedwindow, orientations=8, pixels_per_cell=(16, 16), cells_per_block=(1, 1), visualise=True, normalise=True)

fd2, hog_image2 = hog(trainingsample, orientations=8, pixels_per_cell=(16, 16), cells_per_block=(1, 1), visualise=True, normalise=True)

print len(fd1)
print len(fd2)

这是特征向量之间的长度差异:

Then this is the difference in length between the feature vectors:

2640
616

那么如何处理呢?提取的窗口应该缩小到分类器被训练的样本的大小吗?或者应该根据每个提取的窗口改变/归一化HoG特征的参数吗?还是有另一种方法来做到这一点?

So how is this dealt with? Are extracted windows supposed to be scaled down to the size of the samples the classifier was trained on? Or should the parameters for HoG features be changed/normalized according to each extracted window? Or is there another way to do this?

我个人在python工作,使用scikit-image,但我猜这个问题是独立于我使用的平台。

I'm personally working in python, using scikit-image, but I guess the problem is independent of what platform I'm using.

推荐答案

正如你所说,HOG基本上使用一个以像素为单位建立单元格大小的参数。因此,如果图像大小改变,则细胞数量不同,然后描述符的大小不同。

As you say, HOG basically uses a parameter that establishes the cell size in pixels. So if the image size changes, then the number of cells is different and then the descriptor is different in size.

使用HOG的主要方法是使用像素大小相同的窗口(在训练和测试期间大小相同)。因此提取的窗口应该与 trainingsample 相同。

参考中,有一位用户说:

In that reference, one user says:


HOG不是尺度不变的。为
获得相同长度的特征向量并不保证尺度不变性。

HOG is not scale invariant. Getting the same length feature vector for each image does not guarantee the scale invariance.

size ...

这篇关于选择/规范化HoG参数以进行对象检测?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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