Understanding HoG output

Emmanuelle Gouillart emmanuelle.gouillart at nsup.org
Fri Feb 10 13:33:26 EST 2012


Wow, that was quick ;-) ! Thanks for the pull request, will have a look
at it right now.

Emmanuelle

On Fri, Feb 10, 2012 at 06:17:42PM +0100, Emmanuelle Gouillart wrote:
> Hi Brian,

> thanks a lot for the explanations! I must say that when I had a look at
> the HoG function following Michael's post, I had quite a hard time
> understanding how this function was working. Your explanations do help;
> do you think it would be possible to write a meaningful example using
> HoGs for the example gallery? That might give a good starting point in
> order to use this function. If you don't have the time to write the
> example yourself, any hints on the possible contents would also help.

> Cheers,
> Emmanuelle

> On Fri, Feb 10, 2012 at 01:45:12PM +0000, Brian Holt wrote:
> >    Hi Michael,�

> >      Hi, new to group, new to image processing starting to explore HoG.
> >      Looking for a python implementation and discovered
> >      skimage.feature.hog().

> >    Glad to hear someone's using HoGs!

> >      My plan to run skimage.features.hog over some positive/negative images
> >      and use this to train a svm classifier from scikits-learn. � I am
> >      trying to understand the output hog before I proceed further. � �When
> >      I run skimag.feature.hog() it over a region of interest �it appears to
> >      returns an array. �How do I interpret this array?�

> >    My best suggestion would be that you take a look at the comments written
> >    in `hog.py`. �Each part quotes the relevant section from the Dalal Triggs
> >    paper and then under that implements the code required to do the job.
> >    �Others on this list may have different views, but I'd be reluctant to try
> >    to 'interpret' the flattened descriptor. �

> >      �Is there a way to�reshape the array to see what it was like before it
> >      was flattened or�that doesn't make any sense? �Can I plot the descriptor
> >      returned in
> >      any meaningful way?

> >    Yes, you can reshape the array (but that can be a bit tricky), or you
> >    could modify the hog function to return the unraveled descriptor and ravel
> >    it yourself later if you need it.

> >      Also when I choose to visualise the HoG often where I expected to see
> >      vertical line dominate, say on the edge of builds, the line drawn
> >      often appears to be more dominant at the 45 deg. �Is this expected as
> >      the line drawn is really just the sum of all surrounding orientations
> >      for the "cell"?

> >    A line is drawn for each gradient bin with an intensity proportional to
> >    the magnitude of that gradient. �So, the 'star' shape you see for each
> >    cell is just the superimposition of all of these lines. You should expect
> >    to see dominant lines perpendicular to lines in the image (parallel to the
> >    gradient). Also remember that the default is to use 9 bins, so it may be
> >    that the 45degree dominant line you see is the closest approximation to
> >    horizontal. �You can test this out by trying 8 bins instead of 9.�

> >    I hope it helps, feel free to ask any more questions.
> >    Regards
> >    Brian

> >    On 9 February 2012 06:37, bricklemacho <[1]bricklemacho at gmail.com> wrote:

> >      Thanks in advance,

> >      Michael.



More information about the scikit-image mailing list