Current location - Training Enrollment Network - Mathematics courses - Chapter III Geometric Transformation of Images
Chapter III Geometric Transformation of Images
Geometric transformation is a processing method to move the relative spatial position of image pixels without changing the image content. Include translation, mirror image, transposition, scaling and rotation.

Image geometric transformation is to establish the mapping relationship between the source image and the transformed image.

It can be divided into forward mapping and reverse mapping.

The mathematical formula is shown in the figure. As long as the input pixel coordinates are given, the transformed coordinates can be obtained.

However, forward mapping has the following problems.

The position of pixels in the source image is calculated according to the coordinates of the output image. Reverse mapping is basically used in actual machining.

Translation transformation is to add a specified vertical offset to all coordinates.

Mirror image transformation is a symmetrical transformation with the center line as the axis.

Width is the image width. Represented in matrix form, as shown below

Matlab can use maketform () and imtransform () functions for transformation.

Image transposition is to exchange the position of abscissa and ordinate. The width and height of the transposed image are reversed.

The mathematical expression of image scaling is:

Where sx and sy are scale factors. Backward mapping is used here.

In the process of mapping, floating-point coordinate pixels will be generated, which can be approximated by a series of algorithms.

The commonly used interpolation methods are nearest neighbor interpolation, bilinear interpolation and quadratic cubic interpolation.

In the process of image rotation, it is necessary to transform the coordinates of the image. Convert it into a mathematical coordinate system with the center point as the origin. It requires three steps:

The matrix is expressed as:

Where w and h are the width and height of the original image, and Wnew and Hnew are the width and height of the rotated image.

There is also the problem of floating-point coordinates in the rotation process, and nearest neighbor interpolation and bilinear interpolation are also needed.

Use imrotate () function to rotate in matlab;

B = imrotate(A, angle, method, bbox)

Method is an interpolation method, and bbox is used to decide whether to redefine the size.

Image affine transformation

tform = maketform('affine ',T);

g = imtransform(f,tform,interp);

Interp can be nearest, bilinear or bicubic.

The above content comes from Digital Image Processing: Principle and Practice (matlab Edition) edited by Zuo Fei, and published by Electronic Industry Press. This is a study note.