Affine transformation matrix affine transformation matrices and OpenGL

Source: Internet
Author: User

The transformation model is a geometric transformation model which can best fit two images according to the geometric distortion between the image to be matched and the background image. There are several types of transformation models available: Rigid transformations, affine transformations, perspective transformations, and non-linear transformations, such as:

Reference: http://wenku.baidu.com/view/826a796027d3240c8447ef20.html

The third of these affine transformations is what we sectionto to discuss.

Affine transformations (affine transformation)
Affine transformation is a linear transformation between two-dimensional coordinates and two-dimensional coordinates, maintaining the "straightness" of the two-dimensional graph (the straightness, that is, a straight or straight line does not bend, arc or arc) and "parallelism". Parallelness, in fact, refers to the two-dimensional image to protect the relative position of the relationship is constant, parallel lines or parallel lines, intersecting lines of the same angle. )。

The difference between C and D can be seen:

Affine transformations can be achieved through a series of recombination of atomic transformations, including: translation (translation), scaling (scale), flip (flip), Rotation (Rotation), and clipping (Shear).

Affine transformations can be expressed in the following formula:

Reference: http://wenku.baidu.com/view/826a796027d3240c8447ef20.html

This matrix multiplication is calculated as follows:

The exact two-dimensional affine transformations are calculated as follows:

Several typical affine transformations are as follows:

Translational Transform Translation

To move each point to (X+TX, y+ty), the transformation matrix is:

Translational transformation is a kind of "rigid body transformation", rigid-body transformation, is the ideal object that does not produce deformation.

Effect:

Zoom transform (Scale)

The horizontal axis of each point is enlarged (reduced) to SX times, the ordinate zooms (shrinks) to Sy times, and the transformation matrix is:

The transformation effect is as follows:

Shear Transformations (Shear)

The Transformation matrix is:

Equivalent to a transverse shear and a longitudinal shear compound

Effect:

Rotation transform (Rotation)

The target graph rotates theta radians clockwise around the origin, and the transformation matrix is:

Effect:

Combination

Rotation transformation, the target graph rotates theta radians clockwise (x, y), and the transformation matrix is:

The equivalent of two translation transformations and one-time Origin rotation transformation:

Move to the center node first, then rotate, and then move back.

Reference:
Http://wenku.baidu.com/link?url= Atomiqh400rvickgwh-v5vpbgmtevn7zbtzejhfeepxkqu2llowvdw1iffpqjwazguqsqg1hk0otdrfj4jbsru3ro8bp9vkq8iae0xm_wt7

This transformation matrix can also be described below.

Affine transformation matrix affine transformation matrices and OpenGL

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.