Ask Your Question
2

HoG Descriptor: signed 0-360 orientation bins?

asked 2015-02-09 14:29:25 -0600

verified.human gravatar image

I am trying to use HOG descriptors together with SVM classifiers to build a car detection algorithm. Of course inspiration for this approach is the original paper by Dalal & Triggs in which they build such detector for pedestrian detection. However for pedestrian detection it is best to use 9 orientation bins 0-180 degrees, so the orientation is UNSIGNED. Unfortunately for building a good descriptor for cars I probably need SIGNED orientation bins, for example in total 18 bins in the range 0-360 degrees.

In my application I am using the standard OpenCV implementation for extracting HOG descriptors. Currently only 9 histogram orientation bins are supported (see: http://docs.opencv.org/modules/gpu/do...). Is there any way to work around this limitation and easily compute SIGNED HOG descriptors?

Quote from Dalal & Triggs paper:

For humans, the wide range of clothing and background colours presum- ably makes the signs of contrasts uninformative. However note that including sign information does help substantially in some other object recognition tasks, e.g. cars, motorbikes

edit retag flag offensive close merge delete

Comments

1

after a quick scan of the code, there indeed seems to be a hardcoded limit to 9 bins for the ocl/cuda versions of this (unrolling loops and such)

berak gravatar imageberak ( 2015-02-10 05:46:40 -0600 )edit
1

I would say, are you up to the task of changing the sourcecode? If so, please do submit a PR, this would be useful for everyone. On the other hand, I did a car detector on the 9 bin 0-180 degree approach for aerial imagery and it seemed to work pretty well.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-11 05:40:42 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
4

answered 2015-05-12 10:14:27 -0600

sdika gravatar image

updated 2015-05-13 08:00:08 -0600

Hi,

I made a contribution to opencv for this that has just been included. If you git clone opencv, there is now a boolean variable signedGradient in HogDescriptor. set it to true...

Here is a link to the pull request: https://github.com/Itseez/opencv/pull...

edit flag offensive delete link more

Comments

1

Great! Thank you for the nice addition! Do accept your answer so this look solved. MIght be good to edit your answer and add a link to the merged PR for future reference!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-05-13 01:57:50 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2015-02-09 14:29:25 -0600

Seen: 1,952 times

Last updated: May 13 '15