Is the following code is sufficient for feature detection, extraction of multiple images and storing them into single cell for classification?

1 次查看(过去 30 天)
srcFiles = dir('C:\Users\LENOVO\Desktop\Genuine\1\*.png'); % the folder in which ur images exists
Features = cell(length(srcFiles),1) ;
Valid_points =cell(length(srcFiles),1) ;
for i = 1 : length(srcFiles)
filename = strcat('C:\Users\LENOVO\Desktop\Genuine\1\',srcFiles(i).name);
I1 = rgb2gray(imread(filename));
points1 = detectSURFFeatures(I1); hold on;
[features1, valid_points] = extractFeatures(I1, points1);
Features{i} = features1 ;
Valid_points{i} = valid_points ;
figure; imshow(I1);
plot(valid_points{i}.selectStrongest(10),'showOrientation',true);
end
Features;
Valid_points;
I got a blank graph:
blank graph.png
And i got following error using above code
Error using Feature_storing (line 13)
Cell contents reference from a non-cell array object.

采纳的回答

YT
YT 2019-2-9
Look closely what you're exactly trying to plot
Valid_points{i} = valid_points;
figure; imshow(I1);
plot(valid_points{i}.selectStrongest(10),'showOrientation',true);
Giving variables the same name (except first letter uppercase) is not only confusing for you but also for others that might ever have to read your code. You probably either want to
plot(Valid_points{i});
or
plot(valid_points);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by