How to define number of cells of an image to extract HOG features?
4 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
KALYAN ACHARJYA
on 8 May 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);
I have tried with same CellSize and block size, but didnot get the feature vector having same length.
More Answers (0)
See Also
Categories
Find more on Feature Detection and Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!