10

Video Rotation

Chapter Outline

Video images can be rotated, as well as scaled. Common applications involve surveillance, heads-up displays, military and industrial usages. Images are rotated about a reference point in the image. This can be seen in the image rotation below. Depending upon the location of the reference point, the rotation may also cause the image to move to a different location.

image

Figure 10.1 Image rotation.

The mathematical relationship is quite simple. To perform a rotation of θ, with a normalized reference point (0,0), a pixel at location (x,y) is translated to (x’, y’).

x’ = cos(θ) × x – sin(θ) × y

y = sin(θ) × x + sin(θ) × y

This can be expressed in matrix form as:

image

Figure 10.2 Three-dimensional rotation.

image

For rotation about an arbitrary reference point X0, Y0, the following substitutions are used:

(x −X0) = cos(θ) × (x −X0) – sin(θ) × (y −Y0)

(y’ −Y0) = sin(θ) × (x −X0) + sin(θ) × (y −Y0)

Computing rotations involves multiplications, plus image blending, to overwrite the original pixels with the rotated image.

Rotation for video and imaging applications is considered only for two dimensions. More sophisticated three-dimensional rotations are performed in visual applications such as computer generated graphics, design visualization software and other uses involving depth.

One way to think about this is in the aircraft terms of yaw, roll and pitch.

This motion can be represented using a 3 × 3 matrix, which will rotate a point x, y, z in three-dimensional space to a new location x’, y’, z’.

image

10.1 Interpolation

When rotating images, the new location may not be a valid pixel location. It could land mid-way between pixel locations, or in any other arbitrary location. In this case, better quality can be achieved by interpolation, or calculating the actual values at the valid pixel locations. This is achieved by interpolating between nearby rotated pixels that do not line up with the pixel grid locations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset