HOG features visualisation with OpenCV, HOGDescriptor in C++

ChHaupt picture ChHaupt · Jun 2, 2012 · Viewed 26.2k times · Source

I use the HOGDescriptor of the OpenCV C++ Lib to compute the feature vectors of an images. I would like to visualize the features in the source image. Can anyone help me?

Answer

Jürgen Brauer picture Jürgen Brauer · Jun 28, 2012

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