# HOGDescriptor::compute parameters

My usecase is simple. Given an image I want to find hog descriptors of a particular window (that is I just want to compute HOG features in a window). It seems that I should use HOGDescriptor::compute. But I am not understanding what are the different parameters:

virtual void cv::HOGDescriptor::compute (   InputArray  img,
std::vector< float > &  descriptors,
Size    winStride = Size(),
const std::vector< Point > &    locations = std::vector< Point >()
)


The parameter locations makes sense which I assume tells it where to find the descriptors. The descriptors returned would I have a dimension as computed by the the parameters specified by HOGDescriptor constructor:

(_winSize,
Size    _blockSize,
Size    _blockStride,
Size    _cellSize,
int     _nbins ...)


What I don't understand are the parameters winStride, padding. I understand these parameters are used the way a detection window moves for exhaustive detection. But what are they doing in this function compute. Or it is doing something else?! I do not want to compute descriptors in all possible windows, but in a particular window, so that I can feed the descriptor in my custom svm. Thanks in advance.

edit retag close merge delete

maybe you have something with this link try to understand what they do with other variables, but I think you will understand: http://scikit-image.org/docs/dev/auto...

( 2015-08-12 01:05:22 -0500 )edit

I am interested in knowing padding and winstride in the function compute. I do not understand their need in getting descriptor for one single particular window. It has nothing to do with the hog literature in general, it is to do with this very particular function of opencv.

( 2015-08-12 09:31:52 -0500 )edit

I really never understood the parameters in this functions either, but I guess it has to do with some old implementation or something. Anyway, you can easily achieve what you want (descriptors for a particular window) if you just input that particular window as the img parameter and leave the other default values (and obviously, you will have your result in descriptors. Just make sure your window has the same size as the window of the HOGDescriptor object (this function does not perfom scaling).

( 2015-08-14 02:59:40 -0500 )edit

Sort by » oldest newest most voted

'winStride' = argument (default 8x8)- controls how the window is slide across the input window'. 'padding' = adds a certain amount of extra pixels on each side of the input image. That way the detection window is placed a bit outside the input image. It's because of that padding that HOG can detect people who are very close to the edge of the input image. Setting it to (0,0) add no extra pixels on each side of the input image.

more

Official site

GitHub

Wiki

Documentation