tform function in matlab

15 ビュー (過去 30 日間)
Satarupa Khamaru
Satarupa Khamaru 2017 年 11 月 28 日
回答済み: Qing 2018 年 1 月 6 日
Could anyone please help me to understand the value of tform matrix generated in this code? I got the tform matrix value as
tform.T =
0.9280 -0.0019 0
0.0019 0.9280 0
-90.8909 -31.3300 1.0000
I want to get the value of rotation matrix (2X2) and translation parameters tx and ty. Below is the code:
Image1 = imread('lineseg_left.jpg');
figure(9), imshow(Image1), title('Original image');
[xFixed, yFixed] = getpts;
fixedPoints(:,1) = xFixed;
fixedPoints(:,2) = yFixed;
% Choose points interactively in the displayed image using the mouse.
% Double-click to complete your selection. When you are done, getpts
% returns the position of your points.
Image2 = imread('lineseg_right.jpg');
figure(10), imshow(Image2),title('distorted image');
[xMoving, yMoving] = getpts;
movingPoints(:,1) = xMoving;
movingPoints(:,2) = yMoving; figure(11),imshowpair(Image1,Image2,'montage'),title('Original and distorted image');
%Nonreflective similarity transformations may include a rotation, a scale
% and a translation. Shapes and angles are preserved. Parallel lines remain
% parallel. straight lines remain straight.
% Recover the transformation
tform = fitgeotrans(movingPoints,fixedPoints,'NonreflectiveSimilarity');
% Use the tform estimate to resample the rotated imageto register it with
% the fixed image. The regions of color(green and magenta)in the false
% color overlay image indicate error inthe registration. This eror come
% form a lack of precise correspondance in the control points.
Image2Registered = imwarp(Image2,tform,'OutputView',imref2d(size(Image1)));
figure(12)
imshowpair(Image1,Image2Registered),title('Original image and Registered image');
tform.T %show the transform
  1 件のコメント
Satarupa Khamaru
Satarupa Khamaru 2017 年 11 月 30 日
Anyone to help?

サインインしてコメントする。

回答 (1 件)

Qing
Qing 2018 年 1 月 6 日
Here is a Matlab document that explains each element in the tform matrix.

カテゴリ

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