Bug in affine2d documentation
Mostra commenti meno recenti
here In the example, it is stated a ccw rotation is desired, but the actual tranform does a cw rotation because of the non-standard way the tranform is performed (multiply the matrix by a row vector instead of multiplying the column vector by the matrix):
Define 10-Degree Rotation in the Counter-Clockwise Direction
Create an affine2d object that defines the transformation.
theta = 10;
tform = affine2d([cosd(theta) -sind(theta) 0; sind(theta) cosd(theta) 0; 0 0 1])
Apply forward geometric transformation to an input (U,V) point (5,10).
[X,Y] = transformPointsForward(tform,5,10)
X = 6.6605
Y = 8.9798
They probably wanted to use the a transpose of the used (standard literature ccw rotation) matrix.
1 Commento
Mariano
il 15 Dic 2017
Well, what I found is that, although according to the literature you are right (ie. this matrix should produce a CW rotation because it is trasposed), the Matlab function imwarp actually rotates the image in a CCW direction with this tform! This, I think, is even worst. It imeans that Matlab needs a wrong matrix (at least, different form the literature, for instance Gonzalez and Wood, or even wikipedia) to perform a correct transformation. I would appreciate a clarification from the Matlab team. Thanks!
Risposte (0)
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!