Ask Your Question

student4k's profile - activity

2020-05-25 05:40:57 -0600 received badge  Notable Question (source)
2018-01-06 03:02:01 -0600 received badge  Popular Question (source)
2015-05-02 06:45:28 -0600 asked a question HOG descriptor output

I am figuring out the structure of the HOGDescriptor.execute in Python using the following code:

import cv2
win_size = (64, 128)
img = cv2.imread("test.png")
img = cv2.resize(img, win_size)
img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
d = cv2.HOGDescriptor()
hog = d.compute(img)
print hog.shape

The output is (3780, 1), so it is a 3780-element list. Why? I thought it should be: the number of cells in the image (64*128)/(8*8) = 128 multiplied by the number of bins per cell, i.e. 128*9 = 1152.