Image processing-about pixel coordinate matrix transformation (translation, rotation, scaling, miscutting), image processing Matrix

Source: Internet
Author: User

Image processing-about pixel coordinate matrix transformation (translation, rotation, scaling, miscutting), image processing Matrix

  • Introduction

The coordinate transformation matrix is a 3*3 matrix used to perform coordinate changes on the image and transfer the original coordinate point to the new coordinate point, because an image is composed of a dot matrix and color information at each point, the conversion of the sitting mark is to move each point to form a new image. Specifically, this matrix can be used to zoom in, zoom out, move, rotate, pivot, and twist an image.

  • Translation

  • Rotate

The x '= xcos θ −ysin θ and y are used to rotate the θ degrees counterclockwise around the origin. '= Xsin θ + ycos θ

  • Zoom

  • Miscut

  • Others

  • Demo

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

  • Implementation in Android

The Matrix class can be found. In fact, the matrix class itself provides many similar methods. We only need to call them.

SetScale (float sx, float sy, float px, float py) amplification
SetSkew (float kx, float ky, float px, float py) skew
SetTranslate (float dx, float dy) Translation
SetRotate (float degrees, float px, float py) Rotation

Related Article

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.