File Exchange

image thumbnail

Histogram of Oriented Gradients (HOG) code using Matlab

version 1.2.0.0 (5.09 KB) by Sanyam Garg
Matlab code computes the HOG feature vector for any given image.

46 Downloads

Updated 19 May 2014

View License

Histogram of Oriented Gradients can be used for object detection in an image. Particularly, they were used for pedestrian detection as explained in the paper "Pedestrian Detection using Histogram of Oriented Gradients" By Dalal and Triggs. The Matlab code computes HOG in the detailed manner as explained in the paper. The descriptor can then be used for training a classifier and for detecting object/non-object regions.
For more visit my blog: sanyamgarg.blogspot.com

Comments and Ratings (22)

Han Zhang

Irfan Iqbal

Can any one help me!!!

Please, can we combine Stationary Wavelet Transform with HOG for extracting features from an Image?

simulated

Reema M

Hi, I am trying to understand the code. but, I just can't seem to understand how the formulas for L1-Norm and L2-norm in the code correspond to the formulas provided by Dalal and Triggs in their paper.

Please help.

Prasanna A

Hi tried using the code but it is giving me the following error,
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware
that exceeding your available stack space can crash MATLAB and/or your computer.

Error in imjpgbaselineinfo>recover_valid_marker

can anyone please tell me how to sort this out error

Ming Yue

Nice work, thanks!

I met the same problem, how to solve it?

Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit.
Be aware that exceeding your available stack space can crash MATLAB and/or your computer.
Error in :
ismember>ismemberBuiltinTypes

When running this code it gives the below error. Can any body help me ?
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer.

Error in imjpgbaselineinfo>recover_valid_marker

s priyanka

how to visualize the hog descriptor.please help me.

farah

how to visualise the hog descriptor.I tried doing it with HOGpicture(w,bs) but it is giving error

Sunny

For block normalization, are you using l1-norm?

Nantachai

for test

Sanyam Garg

San Faten: resize all images to the size of 128x64 pixels. Then compute the hog descriptor.

What parameters' setup do you have for the program; e.g. cell size, block size, bin size, etc.

san faten

Hi,I'd like to use HOG with SVM. and the code returns vectors of different sizes for images of different sizes.
But, to train the features with SVM, the descriptors must have the same size.
is there any suggestion how can we use HOG with the SVM? thx in advance

Updates

1.2.0.0

Updates file copyright settings

1.1.0.0

Improved comments and better readability of the code

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