I am trying to extract hog descriptors for some ROI on a given image (2D) using the implementation in OpenCV. 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; opencv-python 4.7.0; Windows 10
An error is thrown as follows.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cv2.error: vector<T> too long
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
import cv2 as cv
hog = cv.HOGDescriptor()
img = cv.imread(<path to image>, cv.IMREAD_GRAYSCALE)
desc = hog.compute(img)
I do understand that there is a limit on vector size but the image size is really not that big which is 193 X 16 (width X height)
Is there a workaround to this problem or am I messing up somewhere?