I am using the code snippet given in here to compute HOG feature of a small image patch. However for the code attached herewith, the variable h
, which is supposed to hold HOG feature values, is returning an empty tuple instead. Can anyone please point me to where am I going wrong in the code?
import numpy as np
import cv2
img = cv2.imread('newimg.jpg')
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img_gray = cv2.resize(img_gray,(50,50))
hog = cv2.HOGDescriptor()
h = hog.compute(img_gray)
print(h)
The test image is attached