Effacer les filtres
Effacer les filtres

How can I store 10 strongest points of surf features of multiple images in one variable using matlab?

1 vue (au cours des 30 derniers jours)
i have 40 images i extract the surf features 10 strongest points in a loop but the variable where i stored the values, it gives me the values of last image i.e. 10x2 values. i want to save the values for all 40 images in that single variable.how can i get for all images?? for 40 images my desired result is 40x 2. any help will be really appreciated.thanks
  2 commentaires
Farman Shah
Farman Shah le 9 Août 2018
Modifié(e) : Stephen23 le 9 Août 2018
this is my code
srcFiles = dir('mypath\*.jpg');
for i = 1 : length(srcFiles)
filename = strcat('mypath',srcFiles(i).name);
input_images = imread(filename);
I2=rgb2gray(input_images);
points1 = detectSURFFeatures(input_images)
strongest = points1.selectStrongest(10);
%
plot(strongest);
strong= round(strongest.Location);
end
Stephen23
Stephen23 le 9 Août 2018
Farman Shah's "Answer" moved here:
the code is working fine but stores only the 10 strongest points of the last image ..i want it to sotre for multiple images in a single variable.so then i can label it for further classification..any hope???

Connectez-vous pour commenter.

Réponse acceptée

Stephen23
Stephen23 le 9 Août 2018
Modifié(e) : Stephen23 le 9 Août 2018
Just use a cell array and indexing:
D = 'mypath';
S = dir(fullfile(D,'*.jpg'));
N = numel(S);
C = cell(1,N);
for kk = 1:N
filename = fullfile(D,S(kk).name);
...
strongest = points1.selectStrongest(10);
C{kk} = strongest;
end
Then the strongest values for each loop iteration are stored in the cell array C.
It is recommended to use fullfile rather than concatenating strings and messing about with file separactor characters.
  10 commentaires
Farman Shah
Farman Shah le 9 Août 2018
Modifié(e) : Farman Shah le 9 Août 2018
okay thank you so much stephen Cobeldick sir..your idea was great and helpful...i asked another question. please have a look of that question too..

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by