Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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 Kommentare
Farman Shah
Farman Shah am 9 Aug. 2018
Bearbeitet: Stephen23 am 9 Aug. 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 am 9 Aug. 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???

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Stephen23
Stephen23 am 9 Aug. 2018
Bearbeitet: Stephen23 am 9 Aug. 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 Kommentare
Farman Shah
Farman Shah am 9 Aug. 2018
Bearbeitet: Farman Shah am 9 Aug. 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..

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by