How to define number of cells of an image to extract HOG features?

5 visualizzazioni (ultimi 30 giorni)
I have a dataset of 245 images of varying sizes. I am going to classify the images using SVM to which I have to apply HOG feature vector as one of the features input to SVM. I'm using the 'extractHOGFeatures' function. As the images are of varying sizes the HOG feature vector generated is also of different length for the images. Can we fix the number of cells for every image so that feature vector length will be same for all images? i.e. keeping number of cells constant for all images and having varying 'cellsize' and varying 'blocksize' for every image.

Risposta accettata

KALYAN ACHARJYA
KALYAN ACHARJYA il 8 Mag 2019
One Way: If you do the imrezise before apply the Hog features, its return the features having same length,
As below example, here im1 and im2 both images having different sizes, but hog features sizes are same.
im1=rgb2gray(imread('test.jpg'));
[rows colm]=size(im1);
im2=rgb2gray(imread('R1.jpg'));
im3=imresize(im1,[rows colm]);
hog_im1=extractHOGFeatures(im1);
hog_im3=extractHOGFeatures(im3);
uuuu.png
I have tried with same CellSize and block size, but didnot get the feature vector having same length.
  1 Commento
D Aghor
D Aghor il 9 Mag 2019
Thank you for the answer. But instead of resizing the images can't we define the no. of cells(not the cell size) for every image?

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by