Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Digital image processing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Affine transformations === [[Affine transformations]] enable basic image transformations including scale, rotate, translate, mirror and shear as is shown in the following examples:<ref name="Gonzalez 2008"/> {| class="wikitable" |- ! Transformation Name ! Affine Matrix ! Example |- | '''[[Identity operation|Identity]]''' | align="center" | <math> \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} </math> | [[File:Checkerboard identity.svg]] |- | '''[[Reflection (mathematics)|Reflection]]''' | align="center" | <math> \begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} </math> | [[File:Checkerboard reflection.svg]] |- | '''[[Scale (ratio)|Scale]]''' | align="center" | <math> \begin{bmatrix} c_x=2 & 0 & 0 \\ 0 & c_y=1 & 0 \\ 0 & 0 & 1 \end{bmatrix} </math> | [[File:Checkerboard scale.svg]] |- | '''[[Rotate]]''' | align="center" | <math> \begin{bmatrix} \cos(\theta) & \sin(\theta) & 0 \\ -\sin(\theta) & \cos(\theta) & 0 \\ 0 & 0 & 1 \end{bmatrix} </math> | [[File:Checkerboard rotate.svg]] where {{math|''θ'' {{=}} {{sfrac|π|6}} {{=}}30°}} |- | '''[[Shear matrix|Shear]]''' | align="center" | <math> \begin{bmatrix} 1 & c_x=0.5 & 0 \\ c_y=0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} </math> | [[File:Checkerboard shear.svg]] |- |} To apply the affine matrix to an image, the image is converted to matrix in which each entry corresponds to the pixel intensity at that location. Then each pixel's location can be represented as a vector indicating the coordinates of that pixel in the image, {{math|[''x'', ''y'']}}, where {{math|''x''}} and {{math|''y''}} are the row and column of a pixel in the image matrix. This allows the coordinate to be multiplied by an affine-transformation matrix, which gives the position that the pixel value will be copied to in the output image. However, to allow transformations that require translation transformations, 3-dimensional [[homogeneous coordinates]] are needed. The third dimension is usually set to a non-zero constant, usually {{math|1}}, so that the new coordinate is {{math|[''x'', ''y'', 1]}}. This allows the coordinate vector to be multiplied by a 3×3 matrix, enabling translation shifts. Thus, the third dimension, i.e. the constant {{math|1}}, allows translation. Because matrix multiplication is [[Associative property|associative]], multiple affine transformations can be combined into a single affine transformation by multiplying the matrix of each individual transformation in the order that the transformations are done. This results in a single matrix that, when applied to a point vector, gives the same result as all the individual transformations performed on the vector {{math|[''x'', ''y'', 1]}} in sequence. Thus a sequence of affine transformation matrices can be reduced to a single affine transformation matrix. For example, 2-dimensional coordinates only permit rotation about the origin {{math|(0, 0)}}. But 3-dimensional homogeneous coordinates can be used to first translate any point to {{math|(0, 0)}}, then perform the rotation, and lastly translate the origin {{math|(0, 0)}} back to the original point (the opposite of the first translation). These three affine transformations can be combined into a single matrix—thus allowing rotation around any point in the image.<ref>{{Cite book|url=https://people.cs.clemson.edu/~dhouse/courses/401/notes/affines-matrices.pdf|title=Affine Transformations|last=House, Keyser|date=6 December 2016|website=Clemson|series=Foundations of Physically Based Modeling & Animation|publisher=A K Peters/CRC Press|isbn=978-1-4822-3460-2|access-date=26 March 2019|archive-url=https://web.archive.org/web/20170830052734/https://people.cs.clemson.edu/~dhouse/courses/401/notes/affines-matrices.pdf|archive-date=30 August 2017|url-status=live}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)