Ask Your Question

in HOG, what if search window stride is smaller than cell size?

asked 2017-09-29 02:26:51 -0500

gino0717 gravatar image

updated 2017-09-30 04:35:38 -0500

Hi, I am reading this toturial and try to make my own HOG-SVM hand detector:

I train some of the hand picture in libsvm, I resize the training data picture to 48x48 and use 12x12 cell to get the hog feature, then I have about 324 feature to represent the hand. After I get the model, I use sliding window to detect hand in image, my sliding window is 72x72 and cell size is 18x18 in order to fit the feature number to my model.

the result is not bad( accurancy ~= 80% ), however, I find that it would always get better accurancy if the stride is smaller than the cell size, for example, I can almost detect every hand (accurancy = 99% ) if the stride is 6 instead of 18, but 6 is not the smallest size of the cell size, and none of the document I read about HOG do such a thing. They always use the cell size as smallest stride. It would be difficult to make a whole HOG map of input image if the stride is smaller than the cell size ( I have to repeatly caculated hog window by window instead of caculated once and just find the ROI in general case)

what should I do if I find that the sliding window with smaller stride than the one in HOG descriptor would get the better result? should I just re-train my model with such a small cell (12x12) ? I'm afraid that if I do so the HOG feature would be much larger and the program would be really slow, but if I want to use the sliding window stride which is smaller than the cell size, It is already slow enough.

thanks for any advice!

edit retag flag offensive close merge delete



take a look at this (i am not an expert but) if you share your training data i will try to help.

sturkmen gravatar imagesturkmen ( 2017-09-29 03:36:35 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-09-29 06:39:02 -0500

It makes sense that reducing the sliding window stride will improve the detection accuracy, because a smaller stride will result in a larger number of feature vectors classification per image.

There is nothing intrinsically wrong in using a stride smaller than cell size, the only drawback is that a smaller stride will result in a heavier image analysis, which may slow down you application, but that is just a balance you need to do between speed and accuracy.

edit flag offensive delete link more


so the stride smaller than cell size is just slow and inconvenience to speed up (since it is not fit the formation if I want to do a whole image HOG map and cut a little rectangle to do svm prediction when using sliding window), but it is not a wrong way to do the hog detection and it is a trade off between speed and accuracy.

gino0717 gravatar imagegino0717 ( 2017-09-30 04:25:19 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-29 02:26:51 -0500

Seen: 620 times

Last updated: Sep 30 '17