フィルターのクリア

How can I detect the SURF Features of 100 images? (I already have the code)

2 ビュー (過去 30 日間)
Lauren Pitts
Lauren Pitts 2019 年 7 月 30 日
コメント済み: Lauren Pitts 2019 年 8 月 2 日
I have two sets of code, the first one detects and extracts 10 strongest points from an image.
clear;
close all;
I = imread('D:\test\chair\0001.png');
figure; imshow(I);
I = rgb2gray(I);
figure; imshow(I);
points = detectSURFFeatures(I);
figure;
imshow(I); hold on;
plot(points.selectStrongest(10));
[features, valid_points] = extractFeatures(I, points);
plot(valid_points.selectStrongest(5),'showOrientation',true);
The second one is a for loop that displays 100 images at once. But how can I insert the for loop into the SURF code?
for i=1:100 % we have 100 images we have in or folder
clc;clear;
images ='C:\Users\pittsl\Desktop\Matlab\train\cup';
pngfiles=dir(fullfile(images,'\*.png*'));
n=numel(pngfiles);
idx=randi(n);
im=pngfiles(idx).name;
im1=imread(fullfile(images,im));
imshow(im1)
end

採用された回答

Jalaj Gambhir
Jalaj Gambhir 2019 年 8 月 2 日
Hi,
I am assuming you want to visualize the keypoints of all the 100 images. You can do so by:
images_dir ='C:\Users\pittsl\Desktop\Matlab\train\cup';
pngfiles=dir(fullfile(images_dir,'\*.png*'));
n=numel(pngfiles);
for i=1:n
figure;
image = pngfiles(i).name;
im1 = imread(fullfile(images_dir,image));
I = rgb2gray(im1);
imshow(I);
points = detectSURFFeatures(I);
imshow(I);
hold on;
plot(points.selectStrongest(10));
[features, valid_points] = extractFeatures(I, points);
plot(valid_points.selectStrongest(5),'showOrientation',true);
end
  1 件のコメント
Lauren Pitts
Lauren Pitts 2019 年 8 月 2 日
This is perfect, thank you so much! @Jalaj Gambhir

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by