compute (cv.HOGDescriptor) - MATLAB File Help |
Returns HOG block descriptors computed for the whole image
descs = hog.compute(im)
descs = hog.compute(im, 'OptionName', optionValue, ...)
hog.getDescriptorSize()
. Matrix of type
single
.[w,h]
. It must be a multiple of
block stride. Not set by default in which case it uses
CellSize
.[w,h]
. default [0,0]{[x,y],...}
at which
descriptors are computed. Not set by default (in which case
descriptors are computed for the whole image with a sliding
window).Computes HOG descriptors of given image.
In case of "dense" descriptors (i.e Locations
is not set), the
number of rows is equal to the number of sliding windows over
the image. Assuming zero padding, this is computed in the
following way:
[h,w,~] = size(im);
windows_per_img = ([w,h] - hog.WinSize) ./ WinStride + 1
num_windows = prod(windows_per_img)
% num_windows = numel(hog.WinSize(1):WinStride(1):w) * ...
% numel(hog.WinSize(2):WinStride(2):h)
The windows cover the image in a top-to-bottom left-to-right order.
In case of "sparse" descriptors (i.e Locations
is set), the
number of rows is equal to the number of locations specified.
The function is mainly used to learn the classifier.
The computed feature vectors are compatible with the INRIA Object Detection and Localization Toolkit OLT.
Access | public |
Sealed | false |
Static | false |