HOGpp

HOGpp implements the rectangular histogram of oriented gradients feature descriptor (R-HOG) using integral histograms. The integral histogram representation allows to quickly compute HOG features in subregions of an image in constant time. This is particularly useful if the features in an image must be computed repeatedly, e.g., in a sliding window manner.

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