CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

Similar documents
Image Warping. Some slides from Steve Seitz

Image Warping (Szeliski Sec 2.1.2)

Image Warping. Some slides from Steve Seitz

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Image Warping CSE399b, Spring 07 Computer Vision

Modeling Transformations

Modeling Transformations

Modeling Transformations

Scene Graphs & Modeling Transformations COS 426

Image Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Modeling Transformations Revisited

Modeling Transformations

Modeling Transformations

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

Transformations II. Week 2, Wed Jan 17

Last Lecture. Edge Detection. Filtering Pyramid

How is project #1 going?

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

Image warping. image filtering: change range of image. image warping: change domain of image g(x) = f(h(x)) h(y)=0.5y+0.5. h([x,y])=[x,y/2] f h

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.

Warping, Morphing and Mosaics

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

Transformations. Examples of transformations: shear. scaling

Image Warping, mesh, and triangulation CSE399b, Spring 07 Computer Vision

Transformations III. Week 2, Fri Jan 19

CS4670: Computer Vision

3-Dimensional Viewing

Editing and Transformation

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

CS559: Computer Graphics

CS770/870 Spring 2017 Transformations

4. Two Dimensional Transformations

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

Homogeneous Coordinates

The 3-D Graphics Rendering Pipeline

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

What and Why Transformations?

Prof. Feng Liu. Winter /05/2019

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates

Vector Algebra Transformations. Lecture 4

1/29/13. Computer Graphics. Transformations. Simple Transformations

2D transformations and homogeneous coordinates

CS 335 Graphics and Multimedia. Geometric Warping

GEOMETRIC TRANSFORMATIONS AND VIEWING

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Image warping/morphing

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

More on Transformations. COS 426, Spring 2019 Princeton University

3D Geometry and Camera Calibration

Computer Graphics. 2D transformations. Transforma3ons in computer graphics. Overview. Basic classes of geometric transforma3ons

Affine and Projective Transformations

3D Coordinates & Transformations

CS770/870 Spring 2017 Transformations

Warping. 12 May 2015

Geometric Model of Camera

Geometric Transformations

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

Transformations using matrices

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

Image Metamorphosis By Affine Transformations

CS F-07 Objects in 2D 1

Polynomials. Math 4800/6080 Project Course

Matrix Transformations. Affine Transformations

MEM380 Applied Autonomous Robots Winter Robot Kinematics

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

CT5510: Computer Graphics. Transformation BOCHANG MOON

M y. Image Warping. Targil 7 : Image Warping. Image Warping. 2D Geometric Transformations. image filtering: change range of image g(x) = T(f(x))

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

1.1 Horizontal & Vertical Translations

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Last week. Machiraju/Zhang/Möller/Fuhrmann

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

CS Computer Graphics: Transformations & The Synthetic Camera

[ ] [ ] Orthogonal Transformation of Cartesian Coordinates in 2D & 3D. φ = cos 1 1/ φ = tan 1 [ 2 /1]

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

Two Dimensional Viewing

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

To Do. Course Outline. Course Outline. Goals. Motivation. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1

What does OpenGL do?

Photo by Carl Warner

Image warping , , Computational Photography Fall 2017, Lecture 10

Geometric Transformations

Notes. University of British Columbia

IMGD The Game Development Process: 3D Modeling and Transformations

3D Computer Vision II. Reminder Projective Geometry, Transformations. Nassir Navab. October 27, 2009

Geometric Transformations Hearn & Baker Chapter 5. Some slides are taken from Robert Thomsons notes.

Matrix Representations

Computer Graphics. 2D Transforma5ons. Review Vertex Transforma5ons 2/3/15. adjust the zoom. posi+on the camera. posi+on the model

High Dimensional Rendering in OpenGL

Unit 2: Function Transformation Chapter 1

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required:

Transcription:

CSE328 Fundamentals of Computer Graphics: Theor, Algorithms, and Applications Hong in State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794-44 Tel: (63)632-845; Fa: (63)632-8334 qin@cs.sunsb.edu http://www.cs.sunsb.edu/~qin

2D-3D Transformations From local, model coordinates to global, world coordinates

Modeling Transformations 2D-3D transformations Specif transformations for objects Allows definitions of objects in their own coordinate sstems Allows use of object definition multiple times in a scene Please pa attention to how OpenGL provides a transformation stack because the are so frequentl reused

Overview 2D Transformations Basic 2D transformations Matri representation Matri composition 3D Transformations Basic 3D transformations Same as 2D

From Model Coordinates to World Coordinates (Local to Global) Model coordinates (local) World coordinates (global) CSE528 Lectures

Basic 2D Transformations Translation: = + t = + t Scale: = * s = * s Shear: = + h * = + h * Rotation: = *cos - *sin = *sin + *cos

Scaling Scaling a coordinate means multipling each of its components b a scalar Uniform scaling means this scalar is the same for all components: Non-uniform scaling: different scalars per component: How can we represent scaling in matri form?

Scaling Operation in Matri Form b a b a

Scaling Scaling operation: Or, in matri form: b a b a scaling matri

Rotation

2-D Rotation = cos() - sin() = sin() + cos()

2D Rotation Derivation = r cos (f) = r sin (f) = r cos (f + ) = r sin (f + ) = r cos(f) cos() r sin(f) sin() = r sin(f) sin() + r cos(f) cos() = cos() - sin() = sin() + cos()

2-D Rotation It is straightforward to see this procedure in matri form: cos sin sin cos Even though sin() and cos() are nonlinear functions of, is a linear combination of and is a linear combination of and

2D Rotation cos sin sin cos

Basic 2D Transformations Translation: = + t = + t Scale: = * s = * s Shear: = + h * = + h * Rotation: = *cos - *sin = *sin + *cos

Basic 2D Transformations Translation: = + t = + t Scale: = * s = * s Shear: = + h * = + h * Rotation: = *cos - *sin = *sin + *cos Transformations can be combined (with simple algebra)

Combining Transformations Transformations can be combined (with simple algebra)

Composite Transformations Transformations can be combined (with simple algebra)

Matri Representation Represent 2D transformation b a matri Multipl matri b column vector appl transformation to point

Overview 2D Transformations Basic 2D transformations Matri representation Matri composition 3D Transformations Basic 3D transformations Same as 2D

Matri Representation a c b d a c b d a c b d

Matri Representation Represent 2D transformation b a matri a c b d Multipl matri b column vector appl transformation to point a c b d a c b d

Matri Representation a c b d e g f h i k j l

Matri Representation Transformations can be combined b multiplication Matrices are a convenient and efficient wa to represent a sequence of transformations!

Matri Representation Transformations combined b multiplication a c b d e g f h i k j l Matrices are a convenient and efficient wa to represent a sequence of transformations!

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Identit? 2D Scale around (,)? s s * * s s

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Rotate around (,)? * cos * sin * sin * cos cos sin sin cos 2D Shear? sh sh * * sh sh

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Mirror about Y ais? 2D Mirror over (,)?

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Translation? t t NO! Onl linear 2D transformations can be represented with a 22 matri

Linear Transformations Linear transformations are combinations of Scale, Rotation, Shear, and Mirror Properties of linear transformations: Satisfies: Origin maps to origin Lines map to lines Parallel lines remain parallel Ratios are preserved Closed under composition a d T( sp s2p2) st ( p) s2t ( p2) c b

Homogeneous Coordinates : How can we represent translation as a 33 matri? t t

Homogeneous Coordinates Homogeneous coordinates represent coordinates in 2 dimensions with a 3- vector homogeneou s coords Homogeneous coordinates appear to be far less intuitive, but the indeed make graphics operations much easier

Homogeneous Coordinates : How can we represent translation as a 33 matri? A: Using the rightmost column: t t Translation t t

Translation Eample of translation t t t t

Homogeneous Coordinates Add a 3rd coordinate to ever 2D point (,, w) represents a point at location (/w, /w) (,, ) represents a point at infinit (,, ) is not allowed Note that, (6,3,); (2,6,2); and (8,9,3) represent the SAME POINT in 2D Convenient coordinate sstem to represent man useful transformations

Basic 2D Transformations Basic 2D transformations as 33 matrices cos sin sin cos t t sh sh Translate Rotate Shear s s Scale

Affine Transformations Affine transformations are combinations of Linear transformations, and Translations Properties of affine transformations: Origin does not necessaril map to origin Lines map to lines Parallel lines remain parallel Ratios are preserved Closed under composition a d w b e c f w

Projective Transformations Projective transformations Affine transformations, and Projective warps w Properties of projective transformations: Origin does not necessaril map to origin Lines map to lines Parallel lines do not necessaril remain parallel Ratios are not preserved Closed under composition a d g b e h c f i w

Overview 2D Transformations Basic 2D transformations Matri representation Matri composition 3D Transformations Basic 3D transformations Same as 2D

Matri Composition Transformations can be combined b matri multiplication w s s t t w cos sin sin cos p = T(t,t ) * R() * S(s,s ) * p

Matri Composition Matrices are a convenient and efficient wa to represent a sequence of transformations General purpose representation Hardware matri multipl p = (T * (R * (S*p) ) ) p = (T*R*S) * p

Matri Composition From local coordinates to global coordinates Be aware: order of transformations matters Matri multiplication is not commutative p = T * R * S * p

Matri Composition A more complicated eample: rotating 9 degrees around the mid-point of a line segment (whose coordinates are (3,2)) Can we change the order between rotation and translation?

Will this sequence of operations work? Matri Composition 2 3 cos(9) sin(9) sin(9) cos(9) 2 3 a a a a

Matri Composition After correctl ordering the matrices Multipl matrices together What results is one matri store it (on stack)! Multipl this matri b the vector of each verte All vertices easil transformed with one matri multipl

Overview 2D Transformations Basic 2D transformations Matri representation Matri composition 3D Transformations Basic 3D transformations Same as 2D

3D Transformations Same idea as 2D transformations Homogeneous coordinates: (,,z,w) 44 transformation matrices w z p o n m l k j i h g f e d c b a w z

Basic 3D Transformations w z w z w z t t t w z z w z s s s w z z w z w z Identit Scale Translation Mirror about Y/Z plane

Basic 3D Transformations w z w z cos sin sin cos Rotate around Z ais: w z w z cos sin sin cos Rotate around Y ais: w z w z cos sin sin cos Rotate around X ais:

Reverse Rotations : How do ou undo a rotation of, R()? A: Appl the inverse of the rotation R - () = R(-) How to construct R-() = R(-) Inside the rotation matri: cos() = cos(-) The cosine elements of the inverse rotation matri are unchanged The sign of the sine elements will flip This is because the rotation matri is orthogonal matri Therefore R - () = R(-) = R T ()

Summar Coordinate sstems are the basis for computer graphics World vs. model coordinates (Global vs. Local) 2-D and 3-D transformations Trigonometr and geometr Matri representations Linear, affine, and projective transformations Matri operations Matri composition