2. Outlines
1 Basic Transformation: Translation, Rotation and Scaling in 2D and 3D
2 Inverse Transformation
3 References
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 2 / 11
3. Basic transformation:
Translation
Mathematical Representation :
x
y
=
1 0
0 1
x
y
+
x0
y0
→ Symmetric (1)
x
y
=
1 0 x0
0 1 y0
x
y
1
→ Non − symmetric (2)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 3 / 11
4. Continued
Symmetric unified expression
x
y
1
=
1 0 x0
0 1 y0
0 0 1
x
y
1
→ Unified expression (3)
Rotation
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 4 / 11
5. Continued–
Mathematical expression
x = r cos(α) and y = r sin(α) (4)
Rotation point
x = r cos(α − θ) and y = r sin(α − θ)
x = r cos(α)cos(θ) + r sin(α)sin(θ)
y = r sin(α)cos(θ) − r cos(α)sin(θ)
(5)
Matrix representation
x
y
=
cos(θ) sin(θ)
−sin(θ) cos(θ)
x
y
→ Unified expression (6)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 5 / 11
6. Scaling–
Scaling
x
y
=
Sx 0
0 Sy
x
y
(7)
Translation operation in 3D
Let p(x, y, z) is translated across a point (x0, y0, z0) then the observed
new point is q(x , y , z ) ⇒ x = x + x0, y = y + y0 and z = z + z0.
Matrix representation:
x
y
z
=
1 0 0 x0
0 1 0 y0
0 0 1 z0
x
y
z
1
(8)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 6 / 11
7. Continued–
x
y
z
1
=
1 0 0 x0
0 1 0 y0
0 0 1 z0
0 0 0 1
x
y
z
1
→ Unified expression (9)
Unified matrix representation
V = AV (10)
A → transformation matrix, V → column vector of original co-ordinates,
V → column vector of transformed co-ordinates.
Translation of the transformed matrix :
T =
1 0 0 x0
0 1 0 y0
0 0 1 z0
0 0 0 1
(11)
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 7 / 11
8. Continued–
In case of scaling
S =
Sx 0 0 x0
0 Sy 0 y0
0 0 Sz z0
0 0 0 1
(12)
In case of rotation α → along x-axis, β → along y-axis, θ → along z-axis
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 8 / 11
9. Concatenation:
Rθ =
cos(θ) sin(θ) 0 0
−sin(θ) cos(θ) 0 0
0 0 1 0
0 0 0 1
, Rα =
1 0 0 0
0 cos(α) sin(α) 0
0 − sin(α) cos(α) 0
0 0 0 1
(13)
Rβ =
cos(β) 0 − sin(β) 0
0 1 0 0
sin(β) 0 cos(β) 0
0 0 0 1
Translation, rotation and scaling about z-axis of a point p(x, y, z) can be
expressed as
V = Rθ(STV )
= AV
(14)
where A = RθST
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 9 / 11
10. Continued–
Inversion operation :
It is a process by which original point is recovered back through the
transformed point.
Multiply A−1 on both side in equation (14) ⇒ A−1V = A−1AV = V
Multiply R−1
θ on both side in equation (14) ⇒ R−1
θ V = R−1
θ AV =
STV ⇒ new point is translated and scaled version of original one.
Multiply S−1
on both side in equation (14) ⇒ S−1
V = S−1
AV =
RθTV ⇒ new point is translated and rotated version of original one.
Note: Here S is diagonal matrix ⇒ S−1V = S−1AV = RθTV
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 10 / 11
11. References
M. Sonka, V. Hlavac, and R. Boyle, Image processing, analysis, and machine vision.
Cengage Learning, 2014.
D. A. Forsyth and J. Ponce, “A modern approach,” Computer vision: a modern
approach, vol. 17, pp. 21–48, 2003.
L. Shapiro and G. Stockman, “Computer vision prentice hall,” Inc., New Jersey,
2001.
R. C. Gonzalez, R. E. Woods, and S. L. Eddins, Digital image processing using
MATLAB. Pearson Education India, 2004.
Subject: Image Procesing & Computer Vision Dr. Varun Kumar (IIIT Surat)Lecture 6 11 / 11