HOG Descriptor in MATLAB

Chris McCormick

To help in my understanding of the HOG descriptor, as well as to allow me to easily test out modifications to the descriptor, I wrote functions in Octave for computing the HOG descriptor for a detection window.

HOG Tutorial

For a tutorial on the HOG descriptor, check out my HOG tutorial post.

Update: Revision 1.2

  • Thanks to Carlos Sampedro Pérez for identifying the bellow issues.
  • Fixed a bug in getHOGDescriptor–it was referencing ‘getUnsHistogram’ instead of ‘getHistogram’
  • The ‘rows’ and ‘columns’ calls were causing problems for Matlab users, so I replaced these with ‘size’ calls. Also expanded ‘+=’ operators for Matlab users.

Source files

getHOGDescriptor.m – Computes the HOG descriptor for a 66×130 pixel image / detection window. The detection window is actually 64×128 pixels, but an extra pixel is required on all sides for computing the gradients.

getHistogram.m – Computes a single 9-bin histogram for a cell. Used by ‘getHOGDescriptor’.

View original post 407 more words


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s