Lecture-5
Lecture-5
2D Geometric Transformations
Lecture – 5
Presented By
Dr. Yin Win Chit
Associate Professor
Transformations
What is transformations?
To manipulate the initially created object and to display the modified object.
Transformations are essential in computer vision to preprocess, standardize,
and enhance image data for better feature extraction, analysis, and model
performance.
Types of Transformations
Basic transformations:
Translation
Scaling
Rotation
Purposes:
Translation
x' = x + tx
y' = y + ty
The translation equation in matrix form:
P' =P+T
𝑥′ 𝑥 𝑡𝑥
𝑦′
= 𝑦
+ 𝑡𝑦
,
𝑥′ 𝑥 𝑡𝑥
where P' = 𝑦′
,P= 𝑦
and T = 𝑡𝑦
.
Scaling
Scaling
x' = x . Sx
y' = y . Sy
The scaling equation in matrix form:
P’ =S.P
𝑥′ 𝑆𝑥 0 𝑥
𝑦′
= 0 𝑆𝑦 . 𝑦
,
𝑥′ 𝑆𝑥 0 𝑥
where P' = 𝑦′
,S= 0 𝑆𝑦 and P = 𝑦
.
Rotation
Rotation
x' = x cos θ − y sin θ
y' = x sin θ + y cos θ
The rotation equation in matrix form,
P' = R.P
𝑥′ cos 𝜃 −𝑠𝑖𝑛𝜃 𝑥
𝑦′
= sin 𝜃 𝑐𝑜𝑠𝜃
. 𝑦
,
𝑥′ cos 𝜃 −𝑠𝑖𝑛𝜃 𝑥
where P' = 𝑦′
,R= sin 𝜃 𝑐𝑜𝑠𝜃
and P = 𝑦
.
Homogeneous Coordinates
Homogeneous Coordinates
A point (x, y) can be re-written in homogeneous coordinates as (xh, yh, h)
1 0 0 1 1
(iii) Scaling x s x 0 0 x
y 0 sy 0 y
1 0 0 1 1
x cos sin 0 x
(iii) Rotation y sin cos 0 y
1 0 0 1 1
Other transformations
Other transformations:
Reflection
Shear
Purposes:
to produces a mirror image
to change the shape of image
Reflection
x-axis y-axis
1 0 0
0 1 0
0 0 1
1 0 0
0 1 0
0 0 1
Reflection – Cont’d
1 0 0 0 1 0
0 1 0 1 0 0
0 0 1 0 0 1
Shear
x’ = x + shx . y x' = x
y' = y + shy . x
y’ = y
The transformation matrix is – The transformation matrix is –
Summary
Let's summarize:
• Basic geometric transformation of 2D object
• Homogeneous coordinates for transformation.