Image manipulation via matrices

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Advertisements

1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
2D Transformations x y x y x y. 2D Transformation Given a 2D object, transformation is to change the object’s Position (translation) Size (scaling) Orientation.
Lesson 10-5: Transformations
Transformations Dilations Translations Reflections Rotations.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Unit 9: Vectors, Matrices and Transformations
Aim: What do we remember about transformations? Do Now: Do Now: Circle what changes in each of the following: Translation: LocationSizeOrientation Dilation:
2.2 Linear Transformations in Geometry For an animation of this topic visit
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Transformations Jehee Lee Seoul National University.
Unit 5: Geometric Transformations.
Transformations A rule for moving every point in a figure to a new location.
Transformations of Geometric Figures Dr. Shildneck Fall, 2015.
Objective: Students will be able to represent translations, dilations, reflections and rotations with matrices.
Copyright © Ed2Net Learning Inc.1. 2 G (4, -1) F (-1, 0) A (-5, 5) P (-4, -1) M (0, 5) B (-5, -3) Warm Up.
Transformations LESSON 26POWER UP FPAGE 169. Transformations The new image is read as “A prime, B prime, C prime”
Honors Geometry.  We learned how to set up a polygon / vertex matrix  We learned how to add matrices  We learned how to multiply matrices.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
Chapter 9 Properties of Transformations Warren Luo Matthew Yom.
8-7 Transformation Objective: Students recognize, describe, and show transformation.
8 th grade Vocabulary Word, Definition, model Unit 3.
CSCE 441 Computer Graphics: 2D Transformations
TRANSFORMATIONS. DEFINITION  A TRANSFORMATION is a change in a figure’s position or size.  An Image is the resulting figure of a translation, rotation,
UNIT 7: TRANSFORMATIONS Final Exam Review. TOPICS TO INCLUDE  Types of Transformations  Translations  Reflections  Rotations  Dilations  Composition.
Lesson 10-5: Transformations 1 Lesson 10-5 Transformations.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Lesson 10-5: Transformations
Translation Symmetry (Sliding).
translations, rotations, and reflections
Transforms.
4-3 Warm Up Lesson Presentation Lesson Quiz
Geometric Transformations
Things Needed Today (TNT): Topic: Congruency & Review of Rotations
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
TRANSFORMATIONS!.
Preview Warm Up California Standards Lesson Presentation.
Computer Graphics Transformations.
Lecture 7 Geometric Transformations (Continued)
Transformations.
Objective Describe how changing slope and y-intercept affect the graph of a linear function. Translations, Rotations, and Reflections. What will happen.
A movement of a figure in a plane.
A movement of a figure in a plane.
Unit 1: Transformations
Day 6 – Introduction to transformations
A movement of a figure in a plane.
Lesson 10-5: Transformations
4-4 Geometric Transformations with Matrices
Transformation in Geometry
Lesson 10-5: Transformations
Transformations Day 1 Notes Slideshow.
Unit 6: Transformations
Unit 5 Transformations in the Plane
Mr. Pearson Inman Middle School January 25, 2011
Unit 4 Transformations.
Warm-up Begin at the word “A.” Every time you move, write down the word(s) upon which you land. heart dream a 1. Move to the consecutive interior angle.
Lesson 10-5: Transformations
When you are on an amusement park ride,
Transformations Dilations Translations Reflections Rotations.
4-3 Warm Up Lesson Presentation Lesson Quiz
Translations, Reflections, & Rotations
Lesson 10-5: Transformations
Transformations Translation Reflection The FRAME Routine
Lesson 10-2 Transformations.
Transformations with Matrices
Sept 10, 2013 Transformations Unit 1Review.
QQ.
SOL 8.8 Students will be using the 8.8 Transformation Chart for Notes
Presentation transcript:

Image manipulation via matrices Stephanie Orgill

Linear Transformations Ax = b is at the center of matrix transformations Think of matrix A as an object that is acting on vector x by multiplication, which produces a new vector Ax. The transformation from x⟶Ax follows a set of rules which preserve the operations of vector addition and scalar multiplication: A(u + v) = Au + Av A(cu) = cAu We can use these rules with transformation matrices to translate, shear, scale, rotate, and reflect images in 2-D space

Translating A vector X is translated by a vector V to X+V. Translation is with vector addition. Say we wish to translate a triangle with vertices at (2, -1), (4, 3), and (-3, -2) 5 units left and 2 units up. To do this, we would take the triangle’s matrix A and add to it the transformation matrix that subtracts 5 from the x values and adds 2 to the y values: Thus the triangle’s location matrix A, composed of vertices x1, x2, x3 are translated by vectors v1, v2, v3 to produce the translation matrix.

Shearing A shear transformation is defined by T(x) = Ax. Shearing a matrix causes each point, or each mij , to be displaced in a fixed direction by an amount proportional to its distance from a line parallel to that direction. Shearing can occur along the vertical or horizontal axes by a scalar k: As an example, let’s vertically shear the following matrix: This has the effect of transforming the grey R into the lopsided red R seen to the right:

Scaling There are two types of scaling: contraction and dilation Contraction occurs when a matrix T is multiplied by a scalar k such that T(x) = kx when 0 ≤ k ≤ 1 Dilation occurs when matrix T is multiplied by k such that T(x) = kx when k > 1 Scaling means that the matrix and the image it represents either grows or shrinks. Scaling is uniform when the x and y values are both scaled by the same k. Take a simple 2x3 matrix and uniformly contract it by multiplying it by k = ½:

Scaling cont’d Scaling does not have to be uniform. Scaling can occur along any axis by applying the correct scaling matrix:

Rotating Images can be rotated counterclockwise around a central point (like the origin) through an angle θ. For example, let’s rotate some (x, y) values by 30 degrees. Remember that cos (30 )= 3 2 and sin 30 = 1 2 . This results in the grey R to the right being twisted about the origin by 30 degrees clockwise (represented by the red R):

Reflecting Reflection is the act of flipping the image across a designated line, such that it is a mirror image of the original. Common types of reflections with their respective matrices are listed below: As an example, let’s flip an arbitrary (x,y) value across x = y and translate it 2 units in each direction to center it:

Transformations in 3-D space Transformations in 3-D space follow the same rules as those in 2-D space, but with slightly more complicated matrices. 3-D transformations require the use of 4x4 matrices, which may seem odd – what’s the fourth dimension? 4-D vectors define space along the x, y, and z axes as well as a fourth dimension w. This dimension is the projective space. To better understand projective space, imagine it as a video projector that is showing a 2-D image; w is the distance from the projector to the screen and it affects the image size/scale. Since some 3-D transformations (like translations) require the use of w, while others do not (like rotation). Remember that the rules of matrix multiplication dictate that a 4x4 matrix cannot be multiplied against a 3x3 matrix, so all 3-D transformations must use 4x4 matrices.

3-D Transformation Matrices The below matrices are examples of some 3-D transformation matrices.

3-D transformation Example: Let’s say an object is located along the vector x = [4 3 2 1] and we want to: translate it by -2 in the x direction, 3 in the y direction, and 1 in the z direction rotate it by 45 degrees along the z axis and 30 degrees along the y axis shear it in the x-direction by 45 degrees The combined transformation matrix (T) is as follows, in order of translation, z rotation, y rotation, and shear:

Example cont’d & Conclusion: Multiplying the location vector x by T will result in x being rotated, translated, and sheared as indicated in the previous slide. In conclusion, matrix transformations are an essential part to many fields like computer science, robotics, and mechatronics. The process for transforming matrices is simple and follows a very clear and consistent set of rules.