Você está na página 1de 7

Affine transformation matrix Affine transformation matrix

RQ RQ- -decomposition decomposition


Measurement based on digital image I
KalleMarjanen
Automation and System Engineering
Tampere University of Technology
Affine transformation Affine transformation
Homogenous affine transformation A
A = MK = M(LS)
M is rotation matrix (orthogonal: M
T
M = I)
K is upper triangular matrix
MLS order of multiplication arbitrary
Transformation for 2-D coordinates
(
(
(

=
(
(
(

1 1
Y
X
A y
x
Affine transformation 2 Affine transformation 2- -D sub D sub--
matrices matrices
Rotation matrix for two dimensions
Shift matrix
(
(
(

=
1 0 0
1 0
0 1
y
x
l
l
L
(
(
(


=
1 0 0
0 cos sin
0 sin cos
| |
| |
M
Affine transformation 2 Affine transformation 2- -D sub D sub--
matrices (2) matrices (2)
Shear & scale matrix
Combined shift, shear & scale
(
(
(

=
1 0 0
0 0
0
y
x
s
k s
S
(
(
(

= =
1 0 0
0
x y
x x
l s
l k s
LS K
Example of affine transformation Example of affine transformation
Parameters
| = 5
o
l
x
=10, l
y
=5
s
x
=2, s
y
=3
k =0.5
0 2 4 6 8 10 12
-8
-6
-4
-2
0
2


xy
uv
T*xy
Tinv*uv
(
(
(


=
1 0 0
0 995 . 0 099 . 0
0 099 . 0 995 . 0
M
(
(
(

=
1 0 0
5 3 0
10 5 . 0 2
K
(
(
(

= =
1 0 0
9767 . 3 0349 . 3 1997 . 0
4492 . 10 198 . 0 99 . 1
MK A
QR QR- -decomposition decomposition
The matrix A is decomposed as
A = QR,
Q is orthogonal matrix (Q
T
Q = I)
R is upper triangular matrix
Used to
Solve linear system of equations
Decompose affine transformation matrices
Recovery of matrix parameters by Recovery of matrix parameters by
QR QR- -decomposition decomposition
The affine matrix is decomposed as
A = QR = MK
The scales, shear and shift are directly
obtained from the matrix K
s
x
=K(1,1), s
y
=K(2,2), l
x
=K(1,3), s
y
=K(2,3), k= K(1,2)
Therotation angle is
| = arcsin(M(2,1))
Please note, that the signs might vary
Check if necessary

Você também pode gostar