# 2x3 Transformation Matrix

Hi,

i would like to know how to read the information of a 2x3 Transformation Matrix. If i am right, it contains the rotation, the translation x/y and the scale x/y. But what is the sixth value used for ?

I need to read the rotation from the matrix in RAD or DEG.

I hope someone can explain me the 2x3 Transformation Matrix a little more detailed.

edit retag close merge delete

Sort by » oldest newest most voted

Sixth value is for shear. Affine transformation (the most general transformation that can be expressed by 2x3 matrix) has rotation, shear, scale x/y, and translation x/y. See this for more details.

Now about your other question. Your assumption is not entirely correct. Rotation, translation, scale or shear are not stored in Transformation Matrix. Lets assume you have 2x3 transformation matrix A.

A = ( (a(0,0),a(0,1),a(0,2)), (a(1,0),a(1,1),a(1,2)) )


Now you want to apply A on point (x,y). Resulting point is this one:

x_new = a(0,0)*x + a(0,1)*y + a(0,2)
y_new = a(1,0)*x + a(1,1)*y + a(1,2)


As you can see none of values of A is actually rotation or scale.

Also it is important to remember that 2x3 matrix don't have to be affine. It can be some simpler transformation as well (rigid, scale, similarity, and so on). For example if a(0,0) = a(1,1) = 1 and a(0,1) = a(1,0) = 0, than your transformation is just translation.

Here I saw very good answer about how to calculate rotation, scale, and translation from transformation matrix. I don't remember how to extract shear, but if you don't have it this will be enough.

more

the transformation matrix contain the relationship between the x' and y' in the image coordinate system and the real world coordinate system which is 3 dimensional !

more

how to get an affine transform based on 6 co-ordinate points?

( 2015-11-18 02:48:11 -0500 )edit

Official site

GitHub

Wiki

Documentation