HOGpp

HOGpp implements the rectangular histogram of oriented gradients feature descriptor (R-HOG) using integral histograms. The integral histogram representation allows computing HOG features for any subregion in constant time regardless of its size. This is particularly useful when extracting features from many overlapping regions, e.g., in sliding-window detection.

HOG features may be seen as a special case of the Scale-invariant Feature Transform (SIFT) computed over a dense grid of keypoints where each block is additionally contrast-normalized.

Features

  • C++ templated implementation

  • Python support for 32, 64, and 80 bit floating point precision

  • Unrestricted input size (e.g., OpenCV as of version 4.12.0 requires the input to be a multiple of the block size)

  • Support for arbitrary integer (8 bit to 64 bit, both signed and unsigned) and floating point input (e.g., OpenCV requires 8-bit unsigned integer input)

  • Masking support (i.e., spatial exclusion of gradient magnitudes from contributing to features)

Comparison to Existing Libraries

The following feature matrix summarizes the differences between existing implementations.

Library

Signed Orientations

Custom Gradients

Masking

Arbitrary Input Size

Implementation

HOGpp

✔️

✔️

✔️

✔️

C++

OpenCV

✔️

C++

scikit-image

✔️

Cython/Python

Indices and tables