Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Digital image processing
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Digital image processing
(section)
Add topic