필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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
Farman Shah
Farman Shah 2018년 8월 9일
편집: Stephen23 2018년 8월 9일
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 2018년 8월 9일
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???

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2018년 8월 9일
편집: Stephen23 2018년 8월 9일
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
Farman Shah
Farman Shah 2018년 8월 9일
편집: Farman Shah 2018년 8월 9일
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..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by