affine transformations

Rotation, scaling, translation, shearing and reflection are all examples of affine transformations.

3X Zoom

1X Zoom

When you do an affine transformation:

Translation

A translatoin is applided to an object by repositioning it along a straight-line path from one coordinate location to another.

We translate a 2D point by adding translation distance, dx and dy, to the orginial coordinate position (x, y) to move the point to a new position (x'. y')

x'= x + dx

y'= y + dy

We can also represent this equation by using programming syntax (don't worry, you don't need to do any programming yet):

new_pixel[x+dx][y+dy]=orginial[x][y]

Let's apply the translation to a digital image. That means every pixel of the image is translated by the same amount.

For example (when dx =3, dy=2):

new_pixel[0+3][0+2] = original[0][0]

==> new_pixel[3][2] = original[0][0]

That mean, the pixel at point(0, 0) will be moved to point(3,2)

Let's do it by using pen and graph paper: