2. Factorizing Transformations
! Opposite of Concatenation of Transformations
! Given a transformation matrix, decompose it into a
sequence of simpler transformations
! Example:
! Question: How to factorize the multiplicative part?
! Is the factorization unique?
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎣
⎡
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎣
⎡
=
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎣
⎡
1
0
0
0
0
1
0
0
1
0
0
1
1
0
0
4
3
2
1
2
1
2
4
3
1
2
1
a
a
a
a
b
b
b
a
a
b
a
a
⎥
⎦
⎤
⎢
⎣
⎡
4
3
2
1
a
a
a
a
3. Decomposition of 2D Transforms
Decomposition of 2D Transforms
! For any given matrix M we can
decompose it into various matrix
products M=M1M2M3 = M3M4M5
etc.
! An interesting result
! any 2D transformation can be written
as
Rotation Scale Rotation
This is called the Factorization of the
matrix.
4. Decomposition of 2D Transforms
Decomposition of Transforms
! A vector is defined by:
! Magnitude
! Direction
! Transformation
! Can either change
! magnitude of a vector
! direction of a vector
! Or both
x
y
(x ,y)
θ
x
y
(x ,y)
(x’,y’)
θ
5. Decomposition of 2D Transforms
Decomposition of Transforms
! A vector is defined by:
! Magnitude
! Direction
! Transformation
! Can either change
! magnitude of a vector
! direction of a vector
! Or both
x
y
(x ,y)
θ
x
y
(x ,y)
(x’,y’)
θ
6. Decomposition of 2D Transforms
Decomposition of Transforms
! Transformation
! Rotation
! Non-uniform Scaling
! Rotation + Scaling | Non-uniform scaling
x
y
(x ,y)
(x’,y’)
θ
x
y
(x ,y)
(x’,y’)
x
y
(x ,y)
(x’,y’)
θ
7. Decomposition of 2D Transforms
Decomposition of Transforms
! Transformation
! Rotation
! Non-uniform Scaling
! Rotation + Scaling | Non-uniform scaling
x
y
(x ,y)
(x’,y’)
θ
x
y
(x ,y)
(x’,y’)
x
y
(x ,y)
(x’,y’)
θ
8. Decomposition of 2D Transforms
Decomposition of Transforms
! Transformation
! Rotation
! Non-uniform Scaling
! Rotation + Scaling | Non-uniform scaling
x
y
(x ,y)
(x’,y’)
θ
x
y
(x ,y)
(x’,y’)
x
y
(x ,y)
(x’,y’)
θ
9. Decomposition of 2D Transforms
Decomposition of Transforms
! Transformation
! Since we can only change the direction and magnitude of a vector
! Any transformation on a vector can be represented by or
decomposed into rotation and scale matrices
x
y
(x ,y)
(x’,y’)
10. Eigenvalues and Eigenvectors
! A matrix act on a vector by changing both its
magnitude and direction
! However, same matrix may act on certain
vectors by changing only their magnitudes and
leaving their directions unchanged (or possibly
reversing it).
! These vectors are the eigenvectors of the matrix
! A matrix act on an eigenvector u by multiply its
magnitude by a factor. This factor is the
eigenvalue λ associated with that eigenvector
x
y
(x1 ,y1)
(x’,y’)
x
y
(x2 ,y2)
(x’,y’)
11. Eigenvalues and Eigenvectors
! A matrix act on a vector by changing both its
magnitude and direction
! However, same matrix may act on certain
vectors by changing only their magnitudes and
leaving their directions unchanged (or possibly
reversing it).
! These vectors are the eigenvectors of the matrix
! A matrix act on an eigenvector u by multiply its
magnitude by a factor. This factor is the
eigenvalue λ associated with that eigenvector
x
y
(x1 ,y1)
(x’,y’)
x
y
(x2 ,y2)
(x’,y’)
18. Factorizing Transformations
! Given a transformation matrix M
! Decompose it into
! If transformation matrix is symmetric
! (M=MT)
! Eigen Value decomposition
! If transformation matrix is not symmetric
! Singular Value decomposition
1.0000 1.7321 0
M = -2.5981 1.5000 0
0 0 1.0000
[U S V] = svd(M)
2.7500 -0.4330 0
M = -0.4330 2.2500 0
0 0 1.0000
[V D] = eig(M)
19. Factorizing Transformations
! Given a transformation matrix M
! Decompose it into
! If transformation matrix is symmetric
! (M=MT)
! Eigen Value decomposition
! If transformation matrix is not symmetric
! Singular Value decomposition
1.0000 1.7321 0
M = -2.5981 1.5000 0
0 0 1.0000
[U S V] = svd(M)
2.7500 -0.4330 0
M = -0.4330 2.2500 0
0 0 1.0000
[V D] = eig(M)
20. Factorizing Transformations
! Given a transformation matrix M
! Decompose it into
! If transformation matrix is symmetric
! (M=MT)
! Eigen Value decomposition
! If transformation matrix is not symmetric
! Singular Value decomposition
1.0000 1.7321 0
M = -2.5981 1.5000 0
0 0 1.0000
[U S V] = svd(M)
2.7500 -0.4330 0
M = -0.4330 2.2500 0
0 0 1.0000
[V D] = eig(M)
21. Singular Value Decomposition
! Symmetric matrices (A=AT) can be decomposed as A=U Σ UT
! Non-symmetric real matrix A can be decomposed as A = UΣV*
! U and V are orthonormal (UUT=I) and Σ is diagonal
! U and V are matrices of Eigen vectors of AAT and ATA respectively
! Diagonal entries of Σ consist of the sqrt of the Eigen values of AAT or
ATA
22. Factorizing Transformations
! A non symmetric real matrix M can be decomposed as
M = U S VT (with U and V being orthonormal, S being a
diagonal
! To compute U S and V,
! Let A = MMT [A is symmetric, even though M isn’t]
! A = (USVT)(USVT)T
! A = US2UT
[A=ΦΛΦT , hence U=Φ and S2 = Λ]
! VT = (US)-1M
23. Singular Value Decomposition
! Let M be a m-by-n matrix whose entries are real numbers.
Then M may be decomposed as
M = U S VT
where:
! U is an m-by-m orthonormal matrix
! S is an m-by-n matrix with non-negative numbers on the main
diagonal and zeros elsewhere
! V is an n-by-n orthonormal matrix
! Example
http://en.wikipedia.org/wiki/Singular_value_decomposition
24. Singular Value Decomposition
! Implication: We can take the multiplicative part of any
transform and describe it as a sequence of a rotation,
scaling and another rotation
! 2D Example: Decomposing an Affine Transformation
M = 0.95 0.49 0.46
0.23 0.89 0.02
0 0 1
>> [U, S, V] = svd(M(1:2, 1:2))
U =
-0.78156 -0.62384
-0.62384 0.78156
S =
1.2904 0
0 0.56789
V =
-0.68658 -0.72705
-0.72705 0.68658
>> U * S * V'
ans =
0.95 0.49
0.23 0.89
Interpretation
in terms of
angles?
25. Decomposition of Transformations
! In summary:
! Every matrix can be decomposed via SVD into a rotation times a
scale times another rotation.
! Only symmetric matrices can be decomposed via Eigen value
decomposition into a rotation times a scale times the inverse rotation.
! Such matrices are a simple scale in an arbitrary direction.
! The SVD of a symmetric matrix will lead to same result as Eigen value
decomposition.
26. Summary: 2D Transformations
! Image Registration
! 2D Transformations
! Scaling
! Shear
! Rotation
! Translation
! Inverse Transformations
! Rotation about an arbitrary point
! Concatenation of
transformations
! Order of transformations
! Factorization of Transformations
! Displacement Models
! Rigid / Euclidean
! Similarity
! Affine
! Projective
! Recovering the best affine
transformation
! Least Squared Error solution
! Pseudo inverse
! Image Warping