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

6 views (last 30 days)
wataru yoshimi
wataru yoshimi on 28 Jan 2017
Answered: Tohru Kikawada on 29 Jan 2017
コントロールポイント選択ツールを使ってレジストレーションをしています。画像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

Accepted Answer

Tohru Kikawada
Tohru Kikawada on 29 Jan 2017
まず、 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

More Answers (0)

Categories

Find more on Code Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!