Search code examples
matlabimage-processingcomputer-visionedge-detection

MATLAB extractHOGFeatures returns empty struct


I am working on a Computer Vision project of extracting the digits from an image. After a bit of pre-processing, following is my image:

enter image description here

I performed sobel edge detection and some other steps and extracted the digits from the image. Now when I apply extractHOGFeatures on the digits, I am getting an empty struct for one of the digits. It doesn't happen with most of the images, just a few.

The code works for 0 but not for 1 and there is no specific pattern in the occurrence of the digits, sometimes none of the digits get features.

enter image description here enter image description here

I cannot see a reason why the code wouldn't work for one segment of an image and not the other. Can anyone please help? Thanks!


Solution

  • The issue was that the default cell size for extractHOGFeatures is [8x8] while some of the extracted images were just [6x6].