OpenCV HOGDescriptor return 值

OpenCV HOGDescriptor return value

为什么 HOG 描述符 return 是 float 而不是 int 的向量?假设 return 一个直方图..

我相信@Micka 是对的:直方图可能已标准化(可能不是 1)。在Wikipedia page on HOG Descriptors上写着:

For improved accuracy, the local histograms can be contrast-normalized by calculating a measure of the intensity across a larger region of the image, called a block, and then using this value to normalize all cells within the block. This normalization results in better invariance to changes in illumination and shadowing.

因此需要 vector<float> 而不是 vector<int>

为了补充我认为正确的先前答案,根据这个HoG note I found clearer than the initial Dalal & Triggs paper,涉及两个规范化步骤:

  • 块规范化

Group the cells into overlapping blocks of 2 x 2 cells each, so that each block has size 2C x 2C pixels. Two horizontally or vertically consecutive blocks overlap by two cells, that is, the block stride is C pixels. As a consequence, each internal cell is covered by four blocks. Concatenate the four cell histograms in each block into a single block feature b and normalize the block feature by its Euclidean norm.

  • HOG 特征归一化

The final normalization makes the HOG feature independent of overall image contrast.

两个连续的 bin 之间也应该有双线性插值投票,以防止量化伪影。

此外,它不能是 int,因为您不仅要计算落入 bin 的梯度向量的数量,还要加上梯度幅度。