Picture Manipulation The manipulation of (already created) pictures. May be applied to vector graphics or bitmaps. We will consider bitmaps and introduce.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Matrix.
Creative Computing. \\ aims By the end of the session you will be able to: 1.Explain the difference between various image file formats 2.Load in and display.
Points, Vectors, Lines, Spheres and Matrices
Announcements. Structure-from-Motion Determining the 3-D structure of the world, and/or the motion of a camera using a sequence of images taken by a moving.
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Linear Transformations
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
1 3D modelling with OpenGL Brian Farrimond Robina Hetherington.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
Course Website: Computer Graphics 3: 2D Transformations.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
6 1 Linear Transformations. 6 2 Hopfield Network Questions.
Graphics Programming Graphics Programming: Transformations.
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
CAP4730: Computational Structures in Computer Graphics
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
CS 450: Computer Graphics 2D TRANSFORMATIONS
College Algebra Fifth Edition James Stewart Lothar Redlin Saleem Watson.
Using Matrices to Perform Geometric Transformations
Unit 9: Vectors, Matrices and Transformations
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices.
Mathematical Fundamentals
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
Recap of linear algebra: vectors, matrices, transformations, … Background knowledge for 3DM Marc van Kreveld.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Lecture Notes: Computer Graphics.
Mathematics for Computer Graphics. Lecture Summary Matrices  Some fundamental operations Vectors  Some fundamental operations Geometric Primitives:
CGPage: 1 東吳資訊科學 江清水 3.1 2D Geometry - points and polygons X Y A point in 2D is represented by two real numbers (X,Y) A line segment is represented by.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Chapter 4 Matrices By: Matt Raimondi.
1 What you will learn  We need to review several concepts from Algebra II: Solving a system of equations graphically Solving a system of equations algebraically.
Geometric Transformations
If A and B are both m × n matrices then the sum of A and B, denoted A + B, is a matrix obtained by adding corresponding elements of A and B. add these.
Matrix Algebra Section 7.2. Review of order of matrices 2 rows, 3 columns Order is determined by: (# of rows) x (# of columns)
8.2 Operations With Matrices
Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CMPS1371 Introduction to Computing for Engineers IMAGES.
Computer Graphics Matrices
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
Honors Geometry.  We learned how to set up a polygon / vertex matrix  We learned how to add matrices  We learned how to multiply matrices.
 An image is the new figure, and the preimage is the original figure  Transformations-move or change a figure in some way to produce an image.
CS 450: COMPUTER GRAPHICS TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics I, Fall 2010 Transformations.
Notes Over 4.2 Finding the Product of Two Matrices Find the product. If it is not defined, state the reason. To multiply matrices, the number of columns.
If A and B are both m × n matrices then the sum of A and B, denoted A + B, is a matrix obtained by adding corresponding elements of A and B. add these.
CSCE 441 Computer Graphics: 2D Transformations
COMPUTER GRAPHICS AND LINEAR ALGEBRA AN INTRODUCTION.
CPT450 – Computer Graphics
Modeling Transformations
13.4 Product of Two Matrices
Transforms.
Computer Graphics 3: 2D Transformations
Chapter 7 Matrix Mathematics
Computer Graphics 3: 2D Transformations
COMP 175: Computer Graphics February 9, 2016
With an immediate use for it
Matrix Algebra.
GAM 325/425: Applied 3D Geometry
1. Write the component form of the vector that
3.6 Multiply Matrices.
Transformations with Matrices
: Chapter 7: Two Dimensional Image Transformation
Presentation transcript:

Picture Manipulation The manipulation of (already created) pictures. May be applied to vector graphics or bitmaps. We will consider bitmaps and introduce the DVE (digital video effect). We will consider scaling, translation and rotation.

Graphic Manipulation Manipulation achieved as a series of transformations. These transformation achieved by matrices. Called transformation matrices. Complex manipulation is achieved by combination (multiplication) of the basic transformation matrices. We will see that the order of multiplication is important.

Manipulating a picture In bitmaps we have to manipulate each pixel in the image. There are three basic operations: –Translation (moving left/right, up/down) –Scaling (making smaller/larger) –Rotation (turning through some angle) Others can be made from combinations of the above.

The equations of manipulation Translation Scaling. Rotation.

Matrix multiplication Multiply each element of a row of the first matrix by each element of the corresponding column of the second matrix. Add the products together. Put the result in position (row of first matrix, column of second matrix) of a new matrix. Repeat for all rows of the first matrix. Means that the number of rows of the first matrix must be the same as the number of columns of the second matrix. Easy for computers.

Matrix multiplication Example: Try it with Matlab. A=[5 8 ; 7 2] B=[6 1 ; 4 3] A*B Try B*A Not the same.

The equations in a matrix form. Scaling Rotation Translation –Could add a translation matrix of a similar form, but it would be simpler if all matrices could be just multiplied by the original co- ordinates.

The equations in a “homogeneous” matrix form. Translation –Special 3x3 form allows translation by multiplication. Scaling Rotation

The Matlab DVE dve.m Need to make transformation matrix first. Lets try scaling: –Tr=[ ; ; 0 0 1] Also find or make two.bmp files of the same size. Syntax –dve –You are prompted to enter the names of the foreground and background pictures, followed by the transformation matrix. Try it.

Exercises in translation, scaling and rotation Now create your own transformation matrices for the following: Translation –Move the foreground picture 200 pixels up and 50 pixels across Scaling –Scale the foreground picture to a tenth of its height and a third of its width. Rotation –Rotate the foreground picture by 45 o clockwise. (You need to call 45 o pi/4 radians for Matlab)

Compound Transformations By multiplying different types of transformation matrix, we can do two (or more) transformations at once. Effectively this transforms the already transformed image.

Compound Transformations For example: Scaling followed by rotation.

Compound Transformations For example: Scaling followed by translation.

Order of transformation matrices Note that Scaling followed by translation is not the same as translation followed by scaling, because we scale the translation in the second case. Rotation followed by scaling distorts the transformation matrix and results in “skew”.

Order of transformation matrices This is true of all compound transformations, so the order is important. Also, because the transformation matrix is multiplied by the object to be transformed, rather than the other way around, “later” operations are on the left of any expression. This may look like the wrong way round.

Exercises in compound transformations. Produce a matrix which produces a two times increase in height, halves the width, and rotates the original image. Repeat the above, but move the image 40 pixels down and 100 pixels across also. Now reverse the order of the transformations and observe the effect. Try your own.

Scaling in PDF In PDF we change the “current transformation matrix” of the “graphics state” using the cm operator. For scaling: – s x 0 0 s y 0 0 cm

Translation in PDF In PDF we change the “current transformation matrix” of the “graphics state” using the cm operator. For translation: – t x t y cm

Rotation in PDF In PDF we change the “current transformation matrix” of the “graphics state” using the cm operator. For rotation: – cos  sin  -sin  cos  0 0 cm –Eg – cm rotates the current co-ordinates by 45 o

Further information Hill, Computer Graphics. Prentice Hall. Adobe specifications available from –Postscript –PDF