Let's focus on the parameters of the previous constructor, here are a few important parameters to study: Winsize (64,128), BlockSize (16,16), Blockstride (8,8), cellsize (8,8), Nbins ( 9). These are Hogdescriptor member variables, and the values in parentheses are their default values, which reflect the parameters of the hog descriptor. Here are a few to show what they mean.
Gradient direction number Nbins
Nbins indicates the number of directions of the gradient in a cell (cell), such as Nbins=9, in which a 9-direction gradient histogram is counted in one cell, with 180/9=20 degrees in each direction.
Hog describing child dimensions
After we have determined the above parameters, we can calculate a dimension of the hog descriptor. The hog source code in OPENCV calculates the dimension of the descriptor according to the following formula.
size_t hogdescriptor::getdescriptorsize () const { Cv_assert (blocksize.width% cellsize.width = 0 && blocksize.height% Cellsize.height = = 0); Cv_assert ((winsize.width-blocksize.width)% Blockstride.width = = 0 && (winsize.height-blocksize.height) % Blockstride.height = = 0); Return (size_t) nbins* (blocksize.width/cellsize.width) * ( blocksize.height/cellsize.height) * (( Winsize.width-blocksize.width)/blockstride.width + 1) * ((winsize.height-blocksize.height)/ Blockstride.height + 1); }
Hogdescriptor parametric plots