How can I detect the SURF features of 400 images? (I want the code)

3 ビュー (過去 30 日間)
lebed toufik
lebed toufik 2022 年 2 月 19 日
コメント済み: lebed toufik 2022 年 2 月 22 日
Hello, can you please help me detect the SURF features of 400 images and stock them in a matrix [?? 400] or [400 ??]?
My code is
clear all, clc, close all;
a=dir('C:\Users\toufik\Desktop\database\ORL\*.jpg');
n= length(a);
for i=1:n
filename=strcat('C:\Users\toufik\Desktop\database\ORL\',a(i).name);
I=imread(filename);
points = detectSURFFeatures(I);
[features, valid_points] = extractFeatures(I, points);
end
  5 件のコメント
lebed toufik
lebed toufik 2022 年 2 月 19 日
@Walter Roberson same problem.
Walter Roberson
Walter Roberson 2022 年 2 月 20 日
a = dir('C:\Users\toufik\Desktop\database\ORL\*.jpg');
n = length(a);
for i=1:n
filename = strcat('C:\Users\toufik\Desktop\database\ORL\',a(i).name);
I = imread(filename);
points = detectSURFFeatures(I);
[features{i}, valid_points{i}] = extractFeatures(I, points);
end
Note that each of the features will be a 2D array; you could reshape that to a row or column if needed.
Note that the number of points detected will depend upon the content of the image, so the features array may be a different size for each input file, even if the input files are all the same size (which is something your code does not promise.)

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

採用された回答

yanqi liu
yanqi liu 2022 年 2 月 21 日
yes,sir,may be you want use surf to classify orl databse,or search image by surf points,so we can use bagOfFeatures to get it,such as
a=dir('C:\Users\toufik\Desktop\database\ORL\*.jpg');
ab = imageSet('C:\Users\toufik\Desktop\database\ORL','recursive');
bag = bagOfFeatures(ab,'Verbose',false);
% get surf feature vector
img = imread(strcat('C:\Users\toufik\Desktop\database\ORL\',a(1).name););
featureVector = encode(bag,img);
  3 件のコメント
yanqi liu
yanqi liu 2022 年 2 月 22 日
yes,sir,may be different image have different surf points number,so the description feature vector may be not the same size,so we can use vision code dictionary to make them same size or choose same number surf points to get same size
lebed toufik
lebed toufik 2022 年 2 月 22 日
@yanqi liu thank you a lot sir.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by