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

コントロールポイント選択ツールを使ってレジストレーションをしています。画像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일

4 개 추천

まず、 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개)

카테고리

도움말 센터File Exchange에서 Code Generation에 대해 자세히 알아보기

질문:

2017년 1월 28일

답변:

2017년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by