I work with a classification algorithm that requires that the size of the vector function of all samples in the training and testing process be the same.
I also have to use the SIFT function extractor. This causes problems because the feature vector of each image approaches as a matrix of different sizes. I know that SIFT detects variable key points in each image, but is there any way to ensure that the size of the SIFT capabilities is consistent so that I don't get an error dimension mismatch.
I tried rootSIFTas a workaround:
[~, features] = vl_sift(single(images{i}));
double_features = double(features);
root_it = sqrt( double_features/sum(double_features) ); %root-sift
feats{i} = root_it;
This gives me a consistent vector 128 x 1for each image, but it does not work for me, since the size of each vector is now very small, and I get a lot NaNin my classification result.
Is there any way to solve this?
source
share