how to get SURF feature vector values of multiple images

Hello, i have extracted surf features from multiple images using the following code.But only the last image feature value is stored in the feature variable used in the code. how to get all the feature vector values..
Thank you... Code:
srcFiles = dir('F:\MTECH\MATLAB\Begin\photos\*.jpg');
for i = 1 : length(srcFiles)
filename = strcat('F:\MTECH\MATLAB\Begin\photos\',srcFiles(i).name);
I1 = rgb2gray(imread(filename));
points1 = detectSURFFeatures(I1);
[features2, valid_points1] = extractFeatures(I1, points1);
figure; imshow(I1); hold on;
plot(valid_points1.selectStrongest(10),'showOrientation',true);
columnvector = rand(1,64);
finalFeature = sum(columnvector(:));
sprintf('%s %d','finalFeature = ' , finalFeature)
end

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Nov. 2016
finalFeature(i) = sum(columnvector(:));
sprintf('%s %d','finalFeature = ' , finalFeature(i))

7 Kommentare

sir.. Now each image is represented with unique surf feature value. So can it be used for input to KNN classification for training set??
I didn't understand your answer. Actually I also need to find the surf features for an image. In your code, "columnvector = rand(1,64);", in this line, you created a column with random values and than next you got the sum of this as your final features. how does this represent the final features? can you please explain?
Walter Roberson
Walter Roberson am 23 Jun. 2017
Bearbeitet: Walter Roberson am 23 Jun. 2017
Good question about why they use rand() here, especially creating a random row vector instead of a random column vector like the variable names suggest.
Note: the original poster will not be notified of your comment.
row vector or column vector, doesn't matter. my question was why created an vector of random values and using the sum of that as final features. why?? I didn't understand the logic behind this.
I do not know why they did that. Unfortunately that was 7 months ago, and they did not leave contact information.
I'm also a bit confused with rand(). It shows that my final features resulted differently every time we run the code.
I think the line with the rand() is "dummy code", put in to allow the framework to be developed but intended for replacement later.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by