next up previous
Next: Derivatives and Gradients Up: Some elementary mathematics for Previous: Matrices

Transformations

Vision often requires transformations of quantities represented by vectors. The transformations might be: rotations, translations, scalings, or conversion into different representations altogether.

One method of applying linear transformations is to multiply the vector containing the quantity to be transformed by a transformation matrix.

If the 2D vector to be transformed is:

and the 2D transformation matrix is:

then the transformed vector is:

A transformation that scales 2D vectors by 2 in the horizontal direction and by 3 in the vertical direction is:

Multiplying vector above by this matrix gives you , as you can easily verify.

The 2D transformation that rotates 2D vector by an anti-clockwise (counterclockwise) angle is given by the matrix:

Thus, the rotated vector is:

Figure 2a) shows an example of the rotation of point to point by angle .

 
Figure 2: a) Anticlockwise rotation of point by angle . b) Translation of point by a vector . 

In more generality, the transformation of an M-dimensional vector:

by matrix is the N-dimensional vector whose component is given by:

Another transformation is the translation of a point position specified by a vector. If the point position is given by and the translation vector is , then the transformed position is given by . Figure 2b shows an example of a translation of point to point by vector

Scaling, rotation and translation can be combined in one operation. Suppose that we have a line shape defined its two endpoints and , and we wish to rotate it by angle , scale it uniformly by and translate it by , so that point is afterwards at point . The combined transformation on any point lying between and is given by:

In fact, this transformation can be applied to any point defined in the same coordinate system as and .

The above specific transformations can be generalized to higher dimensions without much difficulty, except in the case of rotations. Translation is defined simply using a vector of the appropriate dimension. Scaling still uses a diagonal matrix (or can be simplified by replacing the scaling matrix by a scalar if the scaling is the same in all dimensions), but now also of the appropriate dimension. Rotation in 3D requires the use of three angles, and leads to a matrix. There are a variety of ways to specify the three angles and we will not discuss them further here.

Homogeneous coordinates are often used for implementing general projective transformations, including scaling, rotation and translation simultaneously, but this is a more advanced topic and is not discussed here.

We have defined these transformations as generally multiplying a column vector on the right by a matrix on its left. Some texts use row ( i.e. horizontal) vectors and matrix multiply with the row vector on the left and the matrix on the right. There is no fundamental difference to this alternative notation: the geometry described is the same, only the notation is different. Some texts also use positive angles to denote clockwise rotations. The 2D rotation matrix then has the position of the ``--'' sign switched to the other term. There is again no fundamental difference to this, only a difference in notation.



next up previous
Next: Derivatives and Gradients Up: Some elementary mathematics for Previous: Matrices



Bob Fisher
Wed Dec 17 16:49:57 GMT 1997