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

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

 Réponse acceptée

Tohru Kikawada
Tohru Kikawada le 29 Jan 2017

4 votes

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

Plus de réponses (0)

Catégories

En savoir plus sur Code Generation dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by