Histograms of Oriented Gradients

version 1.4.0.0 (2.8 KB) by Leo
mex function for calculating histograms of (oriented) gradients (Dalal & Triggs CVPR 2005).

8.5K Downloads

Updated 15 Aug 2012

View License

A mex function for calculating histograms of (oriented) gradients as described in the paper "Histograms of Oriented Gradients for Human Detection"[1]:

http://lear.inrialpes.fr/pubs/2005/DT05/

Function can be called with either one or two arguments :

hogs = HoG(Image,Params);
or
hogs = HoG(Image);

Params should be a size 5 vector with:

Params(0) = number of orientation bins.
Params(1) = cell size.
Params(2) = block size.
Params(3) = 1 for oriented gradients and 0 otherwise.
Params(4) = value for clipping of the L2-norm.

See [1] for more details on these values.

If the function is called with only one parameter then the default values are used:

Params = [9 8 2 0 0.2];

Function can be called for both a RGB and grayscale image.

The function only supports data of type double, image data should first be cast into double i.e. HoG(double(Image)).

Finally [1] mentions the possibility of downweighting "pixels near the edges
of the block by applying a Gaussian spatial window..." and that this leads to and increase in performance of 1% at 10^-4 FPPW. This downweighting scheme is not used by this function.

The HoG function code is part of the MASH public descriptors ("heuristics"):

https://cordis.europa.eu/project/rcn/93563_en.html

Cite As

Leo (2022). Histograms of Oriented Gradients (https://www.mathworks.com/matlabcentral/fileexchange/33863-histograms-of-oriented-gradients), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!