MATLAB: How to save SIFT feature descriptor as an one dimensional vector.

Computer Vision Toolboximage processingImage Processing Toolbox

hello i want to extract SIFT features from each human face . When i am running the code given at official SIFT website :
[image, descriptors, locs] = sift('1.pgm'); where 1.pgm is one image
I am getting three matrices
image 58x128 double
descriptors 112x92 unit8
locs 58x4 double
What should I choose as a feature vector? Or how to convert the descriptor matrix to 1xN matrix ?

Best Answer

feature_vector = [size(descriptors,1); size(descriptors,2); size(locs,1); double(descriptors(:)); locs(:)];
However, it appears that the number of descriptors output depends in part on image content, so the size of the feature vector would depend upon the image content. That is not suitable: feature vectors need to be of consistent size. You will need to figure out how to deal with that.
Related Question