﻿ opencv学习笔记（20）三线插值插值计算hog - 鸿网互联

# opencv学习笔记（20）三线插值插值计算hog

A naive distribution scheme such as voting the nearest orientation bin would
result in aliasing effects. Similarly, pixels near the cell boundaries would produce aliasing along
spatial dimensions. Such aliasing effects can cause sudden changes in the computed feature。

For example, if a strong edge pixel is at the boundary of a cell in one image and due
to slight change in imaging conditions it falls into the neighbouring cell in the next, the naive
voting scheme assign the pixel’s weight to different histograms bins in the two cases.
vector.（就是说一个胞元中存在的边缘点，在此次插值有了权重，但在下一个胞元中，此边缘点不存在了，这样在另一个胞元中的影响没有了，）

To avoid this, we use 3-D linear interpolation of the pixel weight into the spatial orientation histogram.
In the 3-D space the linear interpolation algorithm is know astrilinearinterpolation.

cell 有交互：还要兼顾相邻的cell，这样做可以提高计算出来的特征向量的鲁棒性，不然的话两个差不多的图，如果有一个强梯度点在两个图中分别落在两个相邻的cell里，但偏差不是太多的话，计算出来的HOG特征向量差别会很大。

：嗯，是那个意思。 这里的线性插值是为了提高最终特征向量的鲁棒性，假设一个大梯度点落在两个相邻的cell1与cell2的边境附近，那么它落在cell1或cell2里这两种情况计算

hist3dbig(biny1,binx1,binz1) =...
hist3dbig(biny1,binx1,binz1) + gs*gaussweight...
* (1-(jorbj-x1)/cellpw)*(1-(iorbi-y1)/cellph)...
*(1-(go-z1)/(or*pi/nthet));

<