Ask Your Question

HOGDescriptor::detectMultiScale parameters

asked 2015-08-06 05:08:25 -0500

krips891 gravatar image

Can someone tell me the parameter win_stride and padding parameters?

I see the parameter block_stride in the constructor. Is it the same as win_stride in the detect* functions? If so, why this duplicate parameter?

I could not find win_stride in the HOG literature. Probably I missed it; it will be nice if someone can explain briefly or point to a source.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-08-06 06:30:42 -0500

LorenaGdL gravatar image

updated 2015-08-06 06:32:00 -0500

The detectMultiScale function automatically uses a sliding window over the whole image, and inside such windows the HOG descriptor is computed, with the corresponding set cell and block parameters. The win_stride parameter controls the movement of the sliding window. A big stride will cause consecutive positions of the sliding window to be far apart (no overlapping) while small stride will cause to have a big overlapped region between two consecutive positions of the sliding window. Obviously, using smaller stride the function will perform more computations (will check more regions), but it will likely lead to more precision of detections.

So, the win_stride parameter is not strictly related to HOG itself but with the method to go over the image. The parameter block_stride is however an internal parameter for HOG computation (if you've read that literature, you've seen it is used to move the blocks over which the normalization of cells is done)

edit flag offensive delete link more


Great explanation. Thanks a lot. I wish there was a slightest hint towards this direction in the OpenCV documentation. Now the param name win_stride makes a lot of sense, probably one can figure out the meaning from the name itself, but it would still be so nice to have some amount of documentation.

krips891 gravatar imagekrips891 ( 2015-08-07 06:44:18 -0500 )edit

You're welcome :) (also you can accept the answer as correct). OpenCV documentation is in some cases very vague, I agree with you, but this is the way it is. People try to contribute but it always difficult to have everything documented

LorenaGdL gravatar imageLorenaGdL ( 2015-08-07 06:51:04 -0500 )edit

Hi can you tell me what are the parameters winstridedoing in the function compute? I asked a separate question by the way:

krips891 gravatar imagekrips891 ( 2015-08-11 05:58:25 -0500 )edit

Question Tools

1 follower


Asked: 2015-08-06 05:08:25 -0500

Seen: 426 times

Last updated: Aug 06 '15