You are on page 1of 32

Transformations

Geometric transformations: Changing an object’s position (translation),


orientation (rotation) or size (scaling)
Geometry
Transformation
Translation
Rotation

y y

. .
P ‘ (x ‘ , y ‘)

𝑎 sin 𝜃
P
(x , y)
𝑎 sin 𝜃 . P (x , y)
a
a
α

θ
θ
𝑎 cos 𝜃 x 𝑎 cos 𝜃 x

𝑥′ cos 𝜃 −𝑠𝑖𝑛𝜃 𝑥
=
𝑦′ 𝑠𝑖𝑛𝜃 cos 𝜃 𝑦

P’ = R P
Scaling
2D Translation using homogeneous coordinates

w=1
2D Rotation using homogeneous coordinates

w=1
2D Scaling using homogeneous coordinates

w=1
Shearing

• X-Shear
• Y shear
2D shear transformation

• Shearing along x-axis: changes object


shape!

• Shearing along y-axis


2D Translation using homogeneous coordinates

• Successive translations:
2D Scaling using homogeneous coordinates

• Successive scalings:
2D Rotation using homogeneous coordinates

• Successive rotations:

or
Composition of transformations

• Important: preserve the order of transformations!

translation + rotation rotation + translation


General form of transformation matrix

rotation, scale translation

• Representing a sequence of transformations as a single


transformation matrix is more efficient!

(only 4 multiplications and 4 additions)


Special cases of transformations

• Rigid transformations
• Involves only translation and
rotation (3 parameters)
• Preserve angles and lengths
Special cases of transformations

• Similarity transformations
• Involve rotation, translation, scaling (4 parameters)
• Preserve angles but not lengths
Affine transformations

• Involve translation, rotation, scale, and shear


(6 parameters)
• Preserve parallelism of lines but not lengths and angles.
Projective Transformations

affine (6 parameters) projective (8 parameters)


Homogeneous coordinates

• Add one more coordinate: (x,y,z) → (xh, yh, zh,w)


• Recover (x,y,z) by homogenizing (xh, yh, zh,w):

• In general, xh=xw, yh=yw, zh=zw

(x, y, z) → (xw, yw, zw, w)

• Each point (x, y, z) corresponds to a line in the 4D-space of


homogeneous coordinates.
Homogeneous coordinates

• (x, y) has multiple representations in homogeneous coordinates:


• w=1 (x,y) → (x,y,1)
• w=2 (x,y) → (2x,2y,2)

• All these points lie on a


line in the space of
homogeneous
coordinates !!
3D Transformations
3D Transformations

• Right-handed
Positive rotation angles for right-handed systems:
(counter-clockwise rotations)
3D Translation
3D Rotation

• Rotation about the z-axis:


3D Rotation (cont’d)

• Rotation about the x-axis:


3D Rotation (cont’d)

• Rotation about the y-axis


3D Scaling
References

1. Slides from CS485/685 Computer Vision, Dr. George Bebis


2. Saxena A, Sahay B. Computer aided engineering design. Springer
Science & Business Media; 2007 Dec 8.

You might also like