![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/631715/image.png)
What exactly is stored in the tdata.T parameter of the output of maketform?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Trethyn Trethyn
am 24 Mai 2021
Kommentiert: Trethyn Trethyn
am 27 Mai 2021
So I'm looking at some Matlab code that was written in 2012, so slightly out of date. In it there is a section where the author uses maketform, and then acesses tform.tdata.T:
T = maketform('affine',U,X);
t = T.tdata.T;
I'm trying to update this, so I looked up maketform to try and ascertain what exactly t will now ctdatontain, and I may just be entirely blind, but I couldn't find anything on it. I would guess from the name that it might be a transposition of the matrix? Uncertain however, and I have little experience with how Matlab looked in 2012. Any help or clarification you could give would be greatly appreciated! Thanks :).
0 Kommentare
Akzeptierte Antwort
Uday Pradhan
am 27 Mai 2021
Hi,
An affine transformation is described in mathematical form as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/631715/image.png)
Here, [x y] are the transformed coordinates while [w z] are the original coordinates. The T matrix (also called the Transformation matrix is stored in T.tdata.T. In the example that you have provided, this transformation matrix (stored in T.tdata.T) is such that it maps each row of U to the corresponding row of X. The U and X arguments are each 3-by-2 and define the corners of input and output triangles. For example:
U = [11 11;21 11; 21 21];
X = [51 51;61 51;61 61];
tform2 = maketform('affine',U,X);
>> tform2.tdata.T
ans =
1 0 0
0 1 0
40 40 1
Now if you check:
>> [U [1;1;1]]*tform2.tdata.T
ans =
51 51 1
61 51 1
61 61 1
which is just [X [1;1;1]]. I hope this helps.
Screenshot taken from:Digital Image Processing Using MATLAB, 2e
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!