処理の自動化
显示 更早的评论
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 个评论
koji Akano
2017-1-18
Jiro Doke
2017-1-20
今後の参考として、コードを表示するとき、読み易いように「{}Code」ボタンでフォーマットを指定してください。(今回は修正しておきました)

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Computer Vision Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!