Ry transformation of two-dimensional images]

Source: Internet
Author: User

转自:lab104_yifanhttp://blog.csdn.net/accelerator_/article/details/39253983

 

1. Basic geometric transformation and Transformation Matrix

Basic ry transformations are geometric transformations relative to the coordinate origin and coordinate axes, including translation, scale, rotation, reflection, and miscutting.

1.1 translation Transformation

It refers to the process of moving point P from one coordinate position to another along a straight line path. This is a rigid-body transformation (rigid-body transformation) for moving objects without deformation, as shown in.

Figure 1-1 Translation

Derivation:

The obtained translation transformation matrix is as follows:

TX and ty are called translation vectors.

 

1.2 Scaling

Scaling refers to the contraction of SX times in X direction and SY times in Y direction relative to the coordinate origin. SX and SY are called the scaling factor.

Figure 1-2 Scaling (SX = 2, Sy = 3)

Derivation:

Matrix:

Scaling changes the object size, as shown in. When SX = Sy> 1, the image scales up proportionally along the two axes. When SX = Sy <1, the image scales down along the two axes. When SX = Sy> Sy, the image is scaled unevenly along the two coordinate axes.

Figure 1-3 proportional Transformation
(A) SX and SY are equal (B) SX and SY are not equal

 

1.3 rotation and Transformation

Two-dimensional rotation refers to the process of rotating a certain angle (clockwise positive, clockwise negative) of point P around the coordinate origin to get a new point P.

Figure 1-4 rotation and Transformation

Derivation: using polar coordinate equations

The matrix that rotates angle θ counterclockwise is as follows:

 

1.4 symmetric transformation

The image after symmetric transformation is the image of the original image about a certain axis or origin.

Figure 1-5 symmetric transformation

(1) x axis symmetry

Figure 1-6 x axis symmetry

(2) Y-axis symmetry

Figure 1-7 Y axis symmetry

(3) symmetric Origin

Figure 1-8 symmetric Origin

(4) y = x axis symmetry

Figure 1-9 y = x axis symmetry

(5) y =-X axis symmetry

Figure 1-10 y =-X axis symmetry

 

1.5 error tangent Transformation

The error tangent transformation is also called shear and dislocation transformation, which is used to produce deformation processing of elastic objects.

Figure 1-11 error tangent Transformation

The transformation matrix of the mistangent transformation is:

(1) staggered along the X direction: B = 0
(2) miscut along the y direction: C = 0
(3) two directions: B and C are not equal to 0.

2. Composite Transformation

If you want to perform more than one geometric transformation for a graph, you can combine the transformation matrices for one-step transformation. Composite transformations have the following properties:

1) Compound Translation

Performing two translations for the same image is equivalent to adding two translations:

2) composite Scaling

Two consecutive scaling operations are equivalent to multiplying the scaling operation:

3) Compound Rotation

Two consecutive rotations are equivalent to adding the two rotation angles:

Scaling and Rotation Transformations are all related to the reference point. All the transformations above are based on the origin point. If relative to a common reference point (XF,YF) For scaling, rotating, is equivalent to moving the point to the coordinate origin, then scaling, rotating, and finally (XF,YF) Point to the original location.

4) about (XF,YF) Point Scaling

5) round (XF,YF) Point Rotation Transformation

 

3. Calculation of Two-dimensional geometric Transformation

All geometric transformations can be expressed in the form of p '= p * t.

(1) point transformation: first, the point is represented as a normalized homogeneous coordinate form, and then multiplied by the transformation matrix.

(2) transformation of a straight line: two endpoints of a straight line are represented in the form of normalized homogeneous coordinates, and then multiplied by the transformation matrix.

(3) polygon Transformation: the polygon vertices are represented as normalized homogeneous coordinates and multiplied by the transformation matrix.

(4) curve transformation: represents each point of the curve in the form of normalized homogeneous coordinates, and then multiplied by the transformation matrix.

4. Matrix point multiplication of composite Transformations

1) if you use the following method to calculate the transformation matrix of geometric Transformation:

As shown in the above example, the first transformation matrix is placed in front, and then the transformation matrix is placed in the back.

2) if you use the following method to calculate the transformation matrix of geometric Transformation:

As shown in the above example, the first transformation matrix is placed behind, and then the transformation matrix is placed above.

This is because of the characteristics of the matrix:

Ry transformation of two-dimensional images]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.