フィルターのクリア

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 Center および File ExchangeImage 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