Show older comments
for文の様なものを用いて,処理を繰り返しさせたいのですが,方法が分かりません.イメージとしては,('DSC07475.JPG')から('DSC07410.JPG')のマッチングを行うのですが07475,07476,07477,07478,07479の画像ファイルを自動的に処理させたいのですが,どうすればよいでしょうか.
I1 = rgb2gray(imread('DSC07471.JPG'));
I2 = rgb2gray(imread('DSC07475.JPG'));%k
例えば,
for k=1:9
I1 = rgb2gray(imread('DSC07471.JPG'));
I2 = rgb2gray(imread('DSC0747k.JPG'));%kを置き自動置き換え
points1 = detectHarrisFeatures(I1);
points2 = detectHarrisFeatures(I2);
[features1, valid_points1] = extractFeatures(I1, points1);
[features2, valid_points2] = extractFeatures(I2, points2);
indexPairs = matchFeatures(features1, features2);
matchedPoints1 = valid_points1(indexPairs(:, 1), :);
matchedPoints2 = valid_points2(indexPairs(:, 2), :);
figure; showMatchedFeatures(I1, I2, matchedPoints1, matchedPoints2);
end
お願いします
2 Comments
koji Akano
on 18 Jan 2017
Jiro Doke
on 20 Jan 2017
今後の参考として、コードを表示するとき、読み易いように「{}Code」ボタンでフォーマットを指定してください。(今回は修正しておきました)

Accepted Answer
More Answers (0)
Categories
Find more on Computer Vision Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!