The deformation applied to the source image is a mathematical transformation that can be either linear or non-linear.
A linear transformation is expressed as:
where
contains the coordinates of pixel from the source image,
contains the coordinates of pixel from the transformed image,
is the transformation matrix.
For example, a translation is given by a transformation matrix defined as:
The coordinates of pixel in the transformed image correspond to those of pixel in the source image after a translation of pixels in and pixels in .
The transformation change the geometry of the image and the intensities of the transformed image are computed by using Interpolation.
The next sections illustrate several common transformations. As an example, Figure 1 presents the source image to which the transformation models are applied.

Figure 1:The source image.
Euclidean transformation¶
An Euclidean transformation, also called rigid transformation, is a linear transformation consisting of a rotation by an angle and a translation in the two axes of . Thus it is defined by 3 parameters and the transformation matrix is:
Specifically, a translation is possible if , and a rotation is possible if .

Figure 2:Translation .

Figure 3:Rotation (the rotation center is pixel ).

Figure 4:Euclidean transformation with and .
Affine transformation¶
An affine deformation is defined by 6 parameters: .
It transforms the source image through a combination of translation, rotation, scaling, and shearing.
Parallel lines remain parallel after the deformation, but their angles change.
The deformation matrix is

Figure 5:Scale of 0.7.

Figure 6:Shear of 0.5

Figure 7:Affine transformation with scale 0.7 and shear 0.5.
Projective transformation¶
A projective transformation, also called homography, preserves lines but not necessarily parallelism. It has 9 parameters which are the 9 elements of the matrix :

Figure 8:Projective transformation with matrix
.
Non-linear transformation¶
Alternatively, non-linear deformations can be defined using specific 2D functions (such as polynomials, sinusoids, splines, or wavelets) or non-parametric deformation fields.

Figure 9:Example of non-linear deformation.