Bug in affine2d documentation
Show older comments
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 Comment
Mariano
on 15 Dec 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!
Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!