Open In App

Geometric Transformation in Image Processing

Last Updated : 17 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Image processing is performed using transformations one of the most common among them is geometric transformation. This method allows us to alter the spatial arrangement of pixels in a image which is important for tasks such as alignment, correction, enhancement and visualization.

Understanding Geometric Transformation

Geometric transformation modifies the location of pixels in a image. It consists of two main steps:

  • Spatial transformation of pixels or coordinates and intensity interpolation.
  • Intensity interpolation is used to assign the intensity value of pixels after spatial transformation.

In a geometric transformation a pixel at coordinate (x, y) will be moved to coordinate (x', y'). That is the coordinate (x', y') of the output image which will have the intensity value of the coordinate (x, y) in the input image. The geometric transformation is given by the equation in matrix form:

\begin{bmatrix}\\x'\\y'\end{bmatrix}= T\begin{bmatrix}\\x\\y \end{bmatrix}= \begin{bmatrix}\\a &b \\c& d\end{bmatrix}\begin{bmatrix}\\x\\y \end{bmatrix}

where:

  • (x, y) is the input coordinate
  • (x', y') is the output coordinate
  • T is the geometric transformation matrix

These transformations are useful for operations like rotation, scaling, translation and shearing.

Different Types of Image Transformation Using Geometric Transformation

Lets see some of the commonly used Image Transformation done using Geometric Transformation

Geometric Transformation in Image Processing

1. Translation

Translation displaces an image by a certain amount of pixels about the x and y axis. This operation translates the image in a way such that every pixel in the image will be shifted to a new position maintaining the shape and size of the image. Its equation is:

\begin{bmatrix}x' \\y'\end{bmatrix}=\begin{bmatrix}x + \Delta x \\y + \Delta y\end{bmatrix}

2. Rotation

Rotation is a process in which a image is simply rotated around the origin or an image center by a given angle. This rotates the image or changes the orientation of an image depending on the angle it has been set to. Its equation is:

\begin{bmatrix}x' \\y'\end{bmatrix}=\begin{bmatrix}\cos\theta & -\sin\theta \\\sin\theta & \cos\theta\end{bmatrix}\begin{bmatrix}x \\y\end{bmatrix}

3. Scaling

Scaling enables one to make the image larger or smaller in size. Most scaling methods preserve aspect ratio but general scaling is achieved by changing the dimension on different axes unlike other methods. Its equation is:

\begin{bmatrix}x' \\y'\end{bmatrix}=\begin{bmatrix}s_x & 0 \\0 & s_y\end{bmatrix}\begin{bmatrix}x \\y\end{bmatrix}

4. Shearing (Skewing)

Shearing displaces the pixel in one direction and as a result it causes an inclined output to be produced. It is similar to rotation but this transformation changes the angles between the axes of the image. Its equation is:

\begin{bmatrix}x' \\y'\end{bmatrix}=\begin{bmatrix}1 & k_y \\k_x & 1\end{bmatrix}\begin{bmatrix}x \\y\end{bmatrix}

5. Affine Transformation

Affine transformation can be defined as translation, rotation, scaling and shearing all at once. It maintains the ‘perpendicularity' between pairs of lines and the ratio between points but not angles or lengths. It is commonly used and known geometric transformation is the affine transformation. In two dimensions these transformations preserve points, straight lines and planes.

All the affine transformations except translation can be represented using a 2 X 2 matrix. But for representing translation we require a 3 X 3 matrix. Hence a 3 X 3 matrix A is used. Affine transformation is expressed using linear equations of matrix and vectors of order 2. The affine transformation is given by the equations in matrix form:

\begin{bmatrix}\\x'\\y'\\1 \end{bmatrix}=A\begin{bmatrix}\\x\\ y\\1\end{bmatrix}= \begin{bmatrix}a &b &c \\ d&e &f \\ 0& 0 &1 \end{bmatrix}\begin{bmatrix}\\x\\y\\1\end{bmatrix}

where:

  • (x, y) is the input coordinate
  • (x', y') is the output coordinate
  • A is the affine transformation matrix

6. Perspective Transformation

Parallax shifts the appearing image perspective until the parallel lines appear to be meeting at the vanishing points. Perspective transformation is also known as projective transformation and homograph. It is a geometric transformation where a point from one plane is mapped to another plane. This makes the object appear from different point of views or perspectives. Perspective transformation has application in the field of computer vision as it is involved in tasks like image stitching, camera calibration and 3-D reconstruction.

It is mathematically represented using a 3 X 3 matrix H (homograph matrix). It is given by the equations in matrix form:

m \begin{bmatrix}\\x'\\ y'\\w'\end{bmatrix}=H\begin{bmatrix}\\x \\y\\1\end{bmatrix}=\begin{bmatrix}a &b &c \\ d &e &f \\ g &h &i \end{bmatrix}\begin{bmatrix}\\x\\y\\1\end{bmatrix}

Where:

  • w'x' = ax + by + c
  • w'y' = dx + ey + f
  • w' = gx + hy + i

To find x' and y' we need to normalize them with respect to w'. Thus the coordinate equations for perspective transformation are:

x'=\frac{ax+by+c}{gx+hy+i_{}}y'=\frac{dx+ey+f}{gx+hy+i}

Applications of Geometric Transformation in Image Processing

  • Image Registration: Registering images from various views or from multiple sensors.
  • Computer Vision: Improving media related to computer vision.
  • Medical Imaging: Understanding and comparing images of MRI, X ray or CT scan.
  • Remote Sensing: Geographical information system analyse satellite or aerial images using this.
  • Robotics: Navigation of robots is done using image analysis of images captured by their camera sensor.

Geometric transformation is used to modify images that include movement, rotation, scaling and skewing with intent of changing the place, direction, size or form of the image regardless of the content of image.


Next Article

Similar Reads