读书笔记:Histograms of Oriented Gradients for Human Detection

HoG作为一个Feature Descriptor,它的目的就是提取出useful feature并且舍弃extraneous feature,把特征交给classification algorithms得出好的分类结果。在reference中有很好的例子。鉴别图片中的纽扣,使用一个边缘检测器,可以清楚的看到纽扣椭圆形的边缘。这例子中,“边缘”就是有用的特征。当然好的特征,还需要鉴别出类似而不是的物体。比如排除轮胎,硬币等(是圆形但不是纽扣)。

Basic idea

HoG使用distribution ( histograms ) of directions of gradients ( oriented gradients ) 作为feature。局部目标的外表和形状可以被局部梯度或边缘方向的分布很好的描述,即使我们不知道对应的梯度和边缘的位置

Step 1 : Preprocessing

Patch

HoG是用于一小块patch上的。patch相当于image上截下来的小图。patch可以任一大小,只有一个约束条件,长宽比要是fixed。譬如大图image of size 720×475。我们截下patch of size 64×128.
patch

What is channel?

Typically, a feature descriptor converts an image of size width x height x 3 (channels ) to a feature vector / array of length n.

3 Channels: RGB?

How to calculate gamma correction?

Step 2 : Calculate the Gradient Images

Calculate the Gradient Patchs

计算梯度为什么要使用这个kernels?
kernel

Step 3 : Calculate Histogram of Gradients in 8×8 cells

Calculate Cell & size of Cell “8×8” & 9-bin histogram

  1. Individual graidents may have noise, but a histogram over 8×8 patch makes the representation much less sensitive to noise.
  2. 8×8 cells in a photo of a pedestrian scaled to 64×128 are big enough to capture interesting features ( e.g. the face, the top of the head etc. ).
  3. The histogram is essentially a vector ( or an array ) of 9 bins ( numbers ) corresponding to angles 0, 20, 40, 60 … 160.

Step 4 : 16×16 Block Normalization

RGB color vector [ 128, 64, 32 ]
The length of this vector is length of this vector
Dividing each element of this vector by 146.64 gives us a normalized vector [0.87, 0.43, 0.22].

vector 2 x [ 128, 64, 32 ] = [ 256, 128, 64 ].
You can work it out yourself to see that normalizing [ 256, 128, 64 ] will result in [0.87, 0.43, 0.22],

Step 5 : Calculate the HOG feature vector

There are 7 horizontal and 15 vertical positions making a total of 7 x 15 = 105 positions.

Therefore, we can make 7 steps in the horizontal direction and 15 steps in the vertical direction which adds up to 7 x 15 = 105 steps. At each step we calculated 36 numbers, which makes the length of the final vector 105 x 36 = 3780.

Reference

https://www.learnopencv.com/histogram-of-oriented-gradients/
http://blog.csdn.net/masibuaa/article/details/14056807

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值