Image processing---about pixel coordinate matrix transformations (translation, rotation, scaling, error cutting)

Source: Internet
Author: User

    • Introduced

Coordinate transformation matrix is a 3*3 matrix, used to coordinate changes to the graph, the original coordinate points transferred to the new coordinate point, because a picture is a bit of the array and the color information on each point, so the transformation of the coordinates, is to move each point to form a new picture. Specifically, zooming in and out, moving, rotating, pivoting, and twisting these effects can all be done with this matrix.

    • Translation

    • Rotating

The transformation formula for the angle of θ rotation counterclockwise around the origin is X ' = xcosθ? ysinθ and Y. ' = xsinθ+ ycosθ

    • Scaling

    • Wrong cut

    • other

    • Demo

See Code: http://download.csdn.net/detail/jarlen/8564513

    • About Android in implementation

The Matrix class can be found, in fact, that the Matrix class itself has provided many similar methods that we can just invoke.

Setscale (float sx, float sy, float px, float py) Zoom in
Setskew (float KX, Float KY, float px, float py) chamfered
Settranslate (float dx, float dy) pan
SetRotate (float degrees, float px, float py) rotation

Image processing---about pixel coordinate matrix transformations (translation, rotation, scaling, error cutting)

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.