JavaScript image processing: affine transformations

Source: Internet
Author: User

Objective

In a previous article, we explained the image pyramid, and this article is about affine transformations.

An imitation?!

Any affine transformation can be converted to, multiplied by a matrix (linear variation), plus a vector (translational change).

In fact, affine is the transformation relation of two pictures.

For example, we can use the affine transformation of the Image: Scaling, rotation, translation and so on.

A mathematical problem

Before we solve the affine problem, let's do a math problem.

As in the figure, for the point (x1, y1), rotate an angle relative to the origin a, then where is this point?

We turn the coordinate system into polar coordinate system, then the point (x1, y1) becomes (r,β), and the rotation becomes (r,α+β).

Back to the rectangular coordinate system, the rotated point becomes (cos (α + β) * r, sin (α + β) * r).

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.