Histogram of Oriented Gradients
The Histogram of Oriented Gradient (HOG) feature descriptor is popular for object detection [1].
In the following example, we compute the HOG descriptor and display a visualisation.
Algorithm overview
Compute a Histogram of Oriented Gradients (HOG) by
(optional) global image normalisation
computing the gradient image in x and y
computing gradient histograms
normalising across blocks
flattening into a feature vector
The first stage applies an optional global image normalisation equalisation that is designed to reduce the influence of illumination effects. In practice we use gamma (power law) compression, either computing the square root or the log of each color channel. Image texture strength is typically proportional to the local surface illumination so this compression helps to reduce the effects of local shadowing and illumination variations.
The second stage computes first order image gradients. These capture contour, silhouette and some texture information, while providing further resistance to illumination variations. The locally dominant color channel is used, which provides color invariance to a large extent. Variant methods may also include second order image derivatives, which act as primitive bar detectors - a useful feature for capturing, e.g. bar like structures in bicycles and limbs in humans.
