Keep SURF features from many images

3 ビュー (過去 30 日間)
Erysham
Erysham 2016 年 9 月 6 日
コメント済み: Erysham 2016 年 9 月 7 日
Hello everybody,
Currently I wanted to extract SURF feature, let say from bunch of images stored in one folder. I run the following code, I managed to get the feature from the last image only. How can we keep the features for all images we extracted?
Thanks.
srcFiles = dir('D:\Phd Study\Matlab Food\fooddemo\try\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('D:\Phd Study\Matlab Food\fooddemo\try\',srcFiles(i).name);
I = imread(filename);
a=rgb2gray(I);
points = detectSURFFeatures(a);
[features, valid_points] = extractFeatures(a, points);
end
figure; imshow(I); hold on;
plot(valid_points.selectStrongest(10),'showOrientation',true);

採用された回答

Thorsten
Thorsten 2016 年 9 月 6 日
The most general form is
[features{i}, valid_points{i}] = extractFeatures(a, points);
if features is just a single number, you can use
[features(i), ...
if features is always a column vector of the same length, you can use
[features(:,i), ...
if features is always a row vector of the same length, you can use
[features(i,:), ...
if features is always a matrix of same size, you can use
[features(:,:,i)
and so on, same for valid_points, of course.
In this case it is efficient to pre-allocate the feature, like
feature = zeros(1, length(srcFiles))
or using
features(1, length(srcFiles)) = 0;
  1 件のコメント
Erysham
Erysham 2016 年 9 月 7 日
Thank you..its works beautifully.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by