フィルターのクリア

Extract transformation matrix from image distortion

3 ビュー (過去 30 日間)
windmill
windmill 2020 年 11 月 4 日
回答済み: Steve Eddins 2020 年 11 月 4 日
Hey, I have used the following code for image distortion using control points. I would like to extract the transformation matrix that has been applied to the distorted image using the imwarp function. Is there any way to extract the transformation matrix so I can apply the same transformation also to other images?
clc
clear all
close all
orthophoto = imread('cropped_image.tif');
figure, imshow(orthophoto)
unregistered = imread('cropped_image2.tif');
figure, imshow(unregistered)
[movingPoints, fixedPoints] = cpselect(unregistered,orthophoto,'Wait',true);
movingPoints
fixedPoints
pause
t = fitgeotrans(movingPoints, fixedPoints,'polynomial', 2);
Rfixed = imref2d(size(orthophoto));
registered = imwarp(unregistered,t,'OutputView',Rfixed);
imshow(registered)
imwrite(registered, 'undistorted_cropped_image2.tif');

採用された回答

Steve Eddins
Steve Eddins 2020 年 11 月 4 日
In your call to fitgeotrans, you have specified that you want a 'polynomial' transformation. This type of transformation is not characterized by a matrix, at least not in the sense of an affine transform matrix. However, you can still use the output, t, in calls to imwarp to warp other images the same way.
In the call to fitgeotrans, if you specify a transform type that is characterized by a matrix, then you can retrieve the matrix using t.T.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by