I am trying to use HoG+SVM to classify objects into different categories. The issue is that the dimension of the training images are different. So, the resulting HoG descriptors have variable lengths. I've extracted the features from all the training images into a cell. Each element i of the cell is a vector of HoG descriptors for image i in the dataset. My question is that how do I make it compatible for training the SVM classifier (using svmtrain function)?
As lejlot correctly mentioned, SVM cannot be trained with variable length vectors.
You can just normalize image size to one, i.e. 256x256. There are 3 possibilities to do this:
All variants are used by different authors and you have to check which one suits your task best.
SVM cannot be trained with variable length vectors. You have to use some kind of transformation which will map your data into constant length representation. You can for example perform well known dimensionality reduction techniques.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With