필터 지우기
필터 지우기

Extract transformation matrix from image distortion

조회 수: 11 (최근 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 CenterFile Exchange에서 Geometric 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