Re: Understanding HoG output
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.
Doh! didn't think to look at the code. Based on this suggestion I have had a look at the code, good level of commenting in the code.
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.
Thanks for the idea.
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.
Ahh.. I guess I was expecting some sort of "edge" like in the edge detector. Makes more sense now. Also, thanks for the simple example.
participants (1)
-
bricklemacho