0% found this document useful (0 votes)
2 views

Lecture-5

The document discusses 2D geometric transformations in computer vision, detailing their importance for image data augmentation and manipulation. It covers basic transformations such as translation, scaling, rotation, and additional transformations like reflection and shear, along with their mathematical representations. Homogeneous coordinates are introduced as a method to combine multiple transformations into a single operation.

Uploaded by

Thet Hsu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture-5

The document discusses 2D geometric transformations in computer vision, detailing their importance for image data augmentation and manipulation. It covers basic transformations such as translation, scaling, rotation, and additional transformations like reflection and shear, along with their mathematical representations. Homogeneous coordinates are introduced as a method to combine multiple transformations into a single operation.

Uploaded by

Thet Hsu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Computer Vision

2D Geometric Transformations
Lecture – 5

Presented By
Dr. Yin Win Chit
Associate Professor
Transformations
What is transformations?

The geometrical changes of an object from a current state to modified state.


Geometric transformations refer to image data augmentation techniques that
alter the geometrical structure of images by shifting pixels to new positions
without changing their values, commonly used in computer vision tasks to
simulate real-world appearance changes.

Why the transformations is needed?

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:

To move the position of objects

To alter the shape / size of objects

To change the orientation of objects


Translation

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

• Perform a sequence of transformation such as translation followed by rotation


and scaling, we need to follow a sequential process
• Translate the coordinates,
• Rotate the translated coordinates, and then
• Scale the rotated coordinates to complete the composite transformation.
• To combine these three transformations into a single transformation,
homogeneous coordinates are used
Homogeneous Coordinates – Cont’d

Homogeneous Coordinates
A point (x, y) can be re-written in homogeneous coordinates as (xh, yh, h)

 The homogeneous parameter h is a non zero value such that:

 We can then write any point (x, y) as (hx, hy, h)

 We can conveniently choose h = 1 so that (x, y) becomes (x, y, 1)


Homogeneous Coordinates
Homogeneous Coordinates
(i) Translation  x  1 0 t x   x 
 y    0 1 t    y 
   y  

 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

Origin Line y=x

 1 0 0 0 1 0 
 0  1 0 1 0 0
   
 0 0 1 0 0 1
Shear

 X-direction shear  Y-direction 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.

You might also like