How to use maketform to get affine transform?

9 ビュー (過去 30 日間)
t
t 2014 年 3 月 14 日
回答済み: Alex Taylor 2014 年 3 月 14 日
I'm unsure from the documentation how to use maketform.
I'm taking two points each from two images and using them to make a similarity matrix A which I then pass into maketform to get an affine transform:
maketform('affine', inv(A)');
What is A supposed to be and what format is it meant to be in? If I pass in a 2x2 matrix I get an error:
Error using maketform>validate_matrix (line 320)
The final column of A must consist of zeroes, except for a one in the last row.

回答 (2 件)

Dishant Arora
Dishant Arora 2014 年 3 月 14 日
A is transformation matrix that is used for scaling, rotating and other spatial transformations. See this blog Spatial transformations: Affine
  1 件のコメント
t
t 2014 年 3 月 14 日
Ah thanks. Is it possible to find the transformation matrix if you have the original point and the transformed point?

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


Alex Taylor
Alex Taylor 2014 年 3 月 14 日
1) Why not just use fitgeotrans to construct your transformation from a set of matched control points?
2) What is inv(A)' ?
Unlike many books, MATLAB uses the convention that an affine transformation is of the form:
T = [A11 A12 0;...
A21 A22 0;...
Tx Ty 1];
Are you possibly using a transposed definition?
3) maketform is not the recommended way of doing this anymore. Try using affine2d/affine3d and imwarp instead of maketform and imtransform.

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by