필터 지우기
필터 지우기

Performing a loop of data structure array

조회 수: 1 (최근 30일)
yatie SUAIB
yatie SUAIB 2013년 6월 4일
Hi, I have a database named 'data' which contains 1x4 structure array.
I want to make a loop that replace the number of the data incrementally by 1. That is firstly i want to read from data 1, then data 2 ie n=1, m=2.for the next cycle it will read data 2 and data 3 ie n=2, m=3, and lastly n=3, m=4. I've try these command but the output is wrong.Please help me.
for n = 1:1:3
for m = n+1:1:4
index_L=matchFeatures(data(n).fL,data(m).fL);
match1=data(n).vptsL(index_L(:,1));
match2=data(m).vptsL(index_L(:,2));
gte = vision.GeometricTransformEstimator; % defaults to RANSAC
gte.Transform = 'Nonreflective similarity';
gte.NumRandomSamplingsMethod = 'Desired confidence';
gte.MaximumRandomSamples = 1000;
gte.DesiredConfidence = 99.8;
[tform_matrix inlierIdx] = step(gte, match2.Location, ...
match1.Location);
cvexShowMatches(data(n).imgL,data(m).imgL,match1(inlierIdx),...
match2(inlierIdx),'ptsLeft1','ptsLeft2');
end
end

채택된 답변

Iain
Iain 2013년 6월 4일
Only use one for loop.
for n = 1:1:3
m = n + 1;
... code
end
  댓글 수: 1
yatie SUAIB
yatie SUAIB 2013년 6월 6일
yes, it's work. Thank you very much.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by