Skip to content Skip to sidebar Skip to footer

Using Hog To Get Image Descriptors But Hog.compute Always Returns 0.0

64x64 image Trying to use OpenCV to do something simple in Python. Using HOG to get the feature vector. But I get all 0.0. I've tried a few images same result. import cv2 image

Solution 1:

Simply using hist = hog.compute(image) gives a non-zero result.

By default winstride, padding, locations are empty tuples. However, if you are firm on using winstride, etc your image is 64x64 and your window size (winsize) is 64x64, adding a 8x8 winstride will cause no overlapping of the window on the image, hence your output is filled with zeros.

To clarify, winsize is the size of the sliding window that is run across the entire image. Since the size of the image and the sliding window is the same, due to the manner in which HoG features are calculated, there will be no features created, which is why you're seeing zeros.

Post a Comment for "Using Hog To Get Image Descriptors But Hog.compute Always Returns 0.0"