Date post: | 18-Nov-2014 |
Category: |
Documents |
Upload: | abbaqnadeem |
View: | 861 times |
Download: | 1 times |
2D Affine Transformation
Presented ByAbbaq Nadeem
Topic
2D Affine transformation
Affine Transformation
• Translation, Scaling, Rotation, Shearing are all affine transformation
• Affine transformation – transformed point P’ (x’,y’) is a linear combination of the original point P (x,y), i.e.
• Any 2D affine transformation can be decomposed into a rotation, followed by a scaling, followed by a shearing, and followed by a translation.
Affine matrix = translation x shearing x scaling x rotation
4
11001232221
131211
y
x
mmm
mmm
y
x
2D Affine Transformations
5
x
yx
y
x
y
6
Translation Re-position a point along a straight line Given a point (x,y), and the translation
distance (tx,ty)
The new point: (x’, y’) x’ = x + tx y’ = y + ty (x,y)
(x’,y’)
OR P’ = P + T where P’ = x’ p = x T = tx y’ y ty
tx
ty
7
Translation
How to translate an object with multiple vertices?
Translate individualvertices
8
2D Rotation
Default rotation center: Origin (0,0)
qq> 0 : Rotate counter clockwise
q< 0 : Rotate clockwise q
9
How to rotate an object with multiple vertices?
Rotate individualVertices
q
2D Rotation
2D Scaling
10
(1,1)
(2,2) Sx = 2, Sy = 2
(2,2)
(4,4)
Not only the object size is changed, it also moved!! Usually this is an undesirable effect
Shearing
Y coordinates are unaffected, but x coordinates are translated linearly with y
That is: y’ = y x’ = x + y * h
11
x 1 h 0 xy = 0 1 0 * y1 0 0 1 1
Finding Affine Transformations Image of 3 points determines affine transformation
12
Finding Affine Transformations Image of 3 points determines affine transformation
13
Finding Affine Transformations Image of 3 points determines affine transformation
14
P
q
rp’
q’r’
15
Finding Affine Transformations Image of 3 points determines affine transformation
q
rp’
q’r’
P
What’s the corresponding point in the right image?