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

5 vues (au cours des 30 derniers jours)
D Aghor
D Aghor le 8 Mai 2019
Modifié(e) : D Aghor le 9 Mai 2019
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.

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 8 Mai 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 commentaire
D Aghor
D Aghor le 9 Mai 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?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by