I am trying to extract hog descriptors for some ROI on a given image (2D) using the implementation in skimage.feature. I have attached some samples of the ROI that I have extracted. I am just using the hog descriptor with all the default values.
Configuration: python:3.9.13; scikit-image: 0.19.2; Windows 10
The feature vector that is returned has nothing i.e. it is a null array ([]).
NOTE: I want to use the HOG descriptors from positive and negative sample to train and Linear SVM model.
Sample ROI positive sample negative sample
Code to reproduce problem
from skimage.feature import hog
import cv2 as cv
img = cv.imread(<path to image>, cv.IMREAD_GRAYSCALE)
desc = hog(img)
print(desc)
#output: array([], dtype=float64)
The feature descriptor should not be null. Even if I am giving a completely blank white image there should be a descriptor. But again I am not getting a descriptor for the positive samples as well.
Can someone please help with what is going wrong or is it an issue with the implementation?