<< Chapter < Page Chapter >> Page >
This module is part of the collection, A First Course in Electrical and Computer Engineering . The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

In the previous section we were able to combine rotation and scaling into a single composite operation by matrix multiplication. Unfortunately, translation cannot yet be included in the composite operator since we do it by addition rather than by multiplication.

Suppose we wish to rotate the image G by π 3 about the point ( - 10 , 10 ) . Our rotation matrix R ( θ ) always rotates about the origin, so we must combine three transformations to accomplish this:

  1. translate the point ( - 10 , 10 ) to the origin;
  2. rotate π 3 radians about the origin; and
  3. translate the origin back to ( - 10 , 10 ) .

For step (i), we have b 0 = l 0 - 10 and

G 1 = G + b 0 1 T .

For step (ii),

G 2 = R ( π 3 ) G 1 = R ( π 3 ) [ G + b 0 1 T ] = R ( π 3 ) G + R ( π 3 ) b 0 1 T .

For step (iii), we can u s e - b 0 from step (i):

G n e w = G 2 - b 0 1 T = R ( π 3 ) G + R ( π 3 ) b 0 1 T - b 0 1 T = R ( π 3 ) G + [ ( R ( π 3 ) - I ) b 0 ] 1 T .

In this example we were unable to find a single matrix operator A to do the entire job. The total transformation took the form

G n e w = A G + b 1 T .

This is called an affine transformation because it involves both multiplication by A and addition of a constant matrix. This is in contrast to the more desirable linear transformation , which involves only multiplication by A .

We will now move toward a modified representation of the image and the operators by rewriting the last equation as

G n e w = [ A b ] G 1 T

where in the example we had A = R ( π 3 ) and b = ( R ( π 3 ) - I ) b 0 .

The matrix G 1 T looks like

x 1 x 2 x n y 1 y 2 y n 1 1 1 ,

and the points ( x i , y i , 1 ) are called homogeneous coordinates . We can modify Equation 5 so that the new point matrix is also in homogeneous coordinates:

G n e w 1 T = A b O T 1 G 1 T .

In the new representation, each point in the image has a third coordinate, which is always a 1. The homogeneous transformation is a 3 × 3 matrix,

A h = A b 0 T 1 ,

which is capable of translation, rotation, and scaling all by matrix multi- plication. Thus, using homogeneous coordinates, we can build compositetransformations that include translation.

In homogeneous coordinates, we have

R ( θ ) = c o s θ - s i n θ 0 s i n θ c o s θ 0 0 0 1 S ( s x , s y ) = s x 0 0 0 s y 0 0 0 1 T ( t x , t y ) = 1 0 t x 0 1 t y 0 0 1 .

The composite transformation to triple the size of an image and then move it 2 units to the left is

A = 1 0 - 2 0 1 0 0 0 l 3 0 0 0 3 0 0 0 1 = 3 0 - 2 0 3 0 0 0 1 .

On the other hand, the composite transformation to move an image 2 units to the left and then triple its size is

B = 3 0 0 0 3 0 0 0 1 1 0 - 2 0 1 0 0 0 1 = 3 0 - 6 0 3 0 0 0 1 .

In the latter case, the distance of the translation is also tripled.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, A first course in electrical and computer engineering. OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10685/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?

Ask