Ask Your Question
2

Extracting HoG features ?

asked 2012-07-23 02:49:33 -0600

sub_o gravatar image

updated 2012-07-23 02:54:12 -0600

Hi everyone, this is my first time posting here.

I am trying to train my own SVM using features extracted using HoG. So far I can use the given pedestrian detector SVM for HoG to detect people. But I want to detect more poses, so I decided to train my own SVM using HoG.

My question is: Is there any OpenCV's API that allow me to extract HoG features and train a SVM later on ?

So far I couldn't find any answer, so I am trying to port HoG library from http://hogprocessing.altervista.org/ to C++, but I just realized that the developers use libsvm library, I am unsure whether I should also port that library.

Edit: I found libsvm library. But I am still wondering if there's any API directly from OpenCV that I can use, or any existing code regarding extracting HoG features within OpenCV's source code.

Thank you very much !

edit retag flag offensive close merge delete

Comments

[TRiBi] Hi there!

I have the same problem. I extract the hog features of every image to train and store them in a CvMat. How can I store them in a file to train?

Kirill Kornyakov gravatar imageKirill Kornyakov ( 2012-07-23 10:51:56 -0600 )edit

@TRiBi, How do you extract the HoG features ? If you could, then maybe you could try to look into SVMLight or libsvm on the format that they required to train your own SVM. I am not sure how to pass it back to OpenCV though.

sub_o gravatar imagesub_o ( 2012-07-23 23:54:08 -0600 )edit

Problem solved!. I parsed every feature vector computed by the function compute() to the LIBSVM input format: <target> <featureNumber>:<featureValue>.

TRiBi gravatar imageTRiBi ( 2012-08-10 12:54:54 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-07-23 03:37:52 -0600

Michael Burdinov gravatar image

As far as i know there is a HoG in OpenCV (class named HOGDescriptor), but its documentation is missing for some reason. Maybe you can use documentation of HOGDescriptor that was implementated on GPU. It is supposed to have API similar to the one that was implemented on CPU.

And I didn't use it myself so I don't know how good it really is.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-07-23 02:49:33 -0600

Seen: 3,273 times

Last updated: Jul 23 '12