HOG features visualisation with OpenCV, HOGDescriptor in C++

HOGgles¹ is a method developed for HOG visualization, published on ICCV 2013. Here is an example:

What does HOG sees?

This visualization tool may be more useful than plotting the gradient vectors of HOG because one can see better why HOG failed for a given sample.

More information can be found here: http://web.mit.edu/vondrick/ihog/


¹C. Vondrick, A. Khosla, T. Malisiewicz, A. Torralba. "HOGgles: Visualizing Object Detection Features" International Conference on Computer Vision (ICCV), Sydney, Australia, December 2013.


I had exactly the same problem today. Computing a HOGDescriptor vector for a 64x128 image using OpenCV's HOGDescriptor::compute() function is easy, but there is no built-in functionality to visualize it.

Finally I managed to understand how the gradient orientation magnitudes are stored in the 3870 long HOG descriptor vector.

You can find my C++ code for visualizing the HOGDescriptor here:

http://www.juergenbrauer.org/old_wiki/doku.php?id=public:hog_descriptor_computation_and_visualization

Hope it helps!

Jürgen