アフィン変換を使って画像を平行移動し、余白を追加するにはどうすればよいですか?
Ältere Kommentare anzeigen
アフィン変換の手順についてご相談させてください。まず、参照用のアフィン変換として、サンプル画像には実際に変化を与えない処理を行っています。
I = imread("pout.tif");
A1 = [1 0 0; 0 1 0; 0 0 1];
tform1 = affinetform2d(A1);
Rout1 = affineOutputView(size(I), tform1, "BoundsStyle", "FollowOutput");
J1 = imwarp(I, tform1, "OutputView", Rout1);
imshow(J1)

次に、以下の2点を実現したいと考えています。
- 画像をY方向(縦方向)に100ピクセル分シフトさせること
- 上記の平行移動によって画像下部に余白を追加すること
しかし、下記の手順を試しても、上記の目的は達成できませんでした。
A2 = [1 0 0; 0 1 100; 0 0 1];
tform2 = affinetform2d(A2);
Rout2 = affineOutputView(size(I), tform2, "BoundsStyle", "FollowOutput");
J2 = imwarp(I, tform2, "OutputView", Rout2);
imshow(J2)

この場合、なぜアフィン変換を適用しても見た目に変化が現れないのでしょうか?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu イメージ解析 finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


