compute (cv.HOGDescriptor) - MATLAB File Help
cv.HOGDescriptor/compute

Returns HOG block descriptors computed for the whole image

descs = hog.compute(im)
descs = hog.compute(im, 'OptionName', optionValue, ...)

Input

Output

Options

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.

See also
Method Details
Access public
Sealed false
Static false