Yamaneko
Yamaneko

Reputation: 3563

OpenCV Cascade Classification with Histogram of Oriented Gradients (HOGs) feature type

I am trying to use the OpenCV's cascade classifier based on Histogram of Oriented Objects (HOGs) feature type -- such as the paper "Fast Human Detection Using a Cascade of Histograms of Oriented Gradients".

Searching in the web, I found that the Cascade Classificator of OpenCV only supports HAAR/LBP feature type (OpenCV Cascade Classification).

Thanks in advance!

EDIT 1

I've kept my search, when I finally found in android-opencv that there is a trunk in Cascade Classifier which allows it to work with HOG features. But I don't know if it works...

Link: http://code.opencv.org/projects/opencv/repository/revisions/6853

EDIT 2

I have not tested the fork above because my problem has changed. But I found an interesting link which may be very useful in the future (when I come back to this problem).

This page contains the source code of the paper "Histograms of Oriented Gradients for Human Detection". Also, more information. http://pascal.inrialpes.fr/soft/olt/

Upvotes: 3

Views: 8190

Answers (3)

Alexey Antonenko
Alexey Antonenko

Reputation: 2627

Yes, you can use cv::CascadeClassifier with HOG features. To do this just load it with hogcascade_pedestrians.xml that you may find in opencv_src-dir/data/hogcascades.

The classifier works faster and its results are much better when it trained with hogcascade in compare with haarcascade...

Upvotes: 1

tmanthey
tmanthey

Reputation: 4615

It now seems to be available also in the non-python code. opencv_traincascade in 2.4.3 has a HOG featuretype option (which I did not try):

 [-featureType <{HAAR(default), LBP, HOG}>]

Upvotes: 1

ely
ely

Reputation: 77424

If you use OpenCV-Python, then you have the option of using some additional libraries, such as scikits.image, that have Histogram of Oriented Gradient built-ins.

I had to solve exactly this same problem a few months ago, and documented much of the work (including very basic Python implementations of HoG, plus GPU implementations of HoG using PyCUDA) at this project page. There is code available there. The GPU code should be reasonably easy to modify for use in C++.

Upvotes: 3

Related Questions