レジストレーションした画像を重ねて表示

7 次查看(过去 30 天)
wataru yoshimi
wataru yoshimi 2017-1-28
コントロールポイント選択ツールを使ってレジストレーションをしています。画像1と画像2でサイズが異なります。その画像を位置合わせした後に画像を対応点の部分を重ねて表示する方法を教えてください。 試したコード
cpselect(I1,I2);
mytform = fitgeotrans(movingPoints, fixedPoints, 'affine');
I2_reg = imwarp(I2, mytform);
imshow(I1);
hold on
imshow(I2_reg);
alpha 0.4

采纳的回答

Tohru Kikawada
Tohru Kikawada 2017-1-29
まず、 imwarp 'OutputView' オプションで出力サイズを入力サイズに合わせる必要があります。
Rortho = imref2d([size(I1,1) size(I1,2)]);
I2_reg = imwarp(I2, mytform'OutputView',Rortho);
次に imshowpair で画像を重ねがきできます。
figure, imshowpair(I2_reg,I1,'blend');
ドキュメントのサンプルコードが役に立つと思います。
困ったときに下記のように検索しても出てきます。
>> doc cpselect

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Code Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by