Geometric Transformations

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

2D/3D Geometric Transformations and Scene Graphs

Vector Algebra Transformations. Lecture 4

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

Graphics Pipeline 2D Geometric Transformations

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Transforms. COMP 575/770 Spring 2013

Linear and Affine Transformations Coordinate Systems

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Translation. 3D Transformations. Rotation about z axis. Scaling. CS 4620 Lecture 8. 3 Cornell CS4620 Fall 2009!Lecture 8

CS354 Computer Graphics Rotations and Quaternions

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

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

CT5510: Computer Graphics. Transformation BOCHANG MOON

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

METR 4202: Advanced Control & Robotics

Transformations Week 9, Lecture 18

An idea which can be used once is a trick. If it can be used more than once it becomes a method

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

CS559: Computer Graphics

Lecture 5 2D Transformation

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

3D Geometry and Camera Calibration

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

Humanoid Robotics. Projective Geometry, Homogeneous Coordinates. (brief introduction) Maren Bennewitz

GEOMETRIC TRANSFORMATIONS AND VIEWING

θ x Week Date Lecture (M: 2:05p-3:50, 50-N202) 1 23-Jul Introduction + Representing Position & Orientation & State 2 30-Jul

3D Viewing. CS 4620 Lecture 8

Rotations (and other transformations) Rotation as rotation matrix. Storage. Apply to vector matrix vector multiply (15 flops)

Orientation & Quaternions

2D transformations: An introduction to the maths behind computer graphics

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Autonomous Navigation for Flying Robots

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

XPM 2D Transformations Week 2, Lecture 3

Transformations. Examples of transformations: shear. scaling

2D Object Definition (1/3)

To do this the end effector of the robot must be correctly positioned relative to the work piece.

CSE328 Fundamentals of Computer Graphics

2D and 3D Transformations AUI Course Denbigh Starkey

Monday, 12 November 12. Matrices

XPM 2D Transformations Week 2, Lecture 3

Specifying Complex Scenes

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9

For each question, indicate whether the statement is true or false by circling T or F, respectively.

MCE/EEC 647/747: Robot Dynamics and Control. Lecture 3: Forward and Inverse Kinematics

CMSC 425: Lecture 6 Affine Transformations and Rotations

CS184: Using Quaternions to Represent Rotation

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

Matrices. Chapter Matrix A Mathematical Definition Matrix Dimensions and Notation

Today s Topics. 3. Transformations in 2D. 4. Coordinate-free geometry. 5. 3D Objects (curves & surfaces) 6. Transformations in 3D

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

METR Robotics Tutorial 2 Week 3: Homogeneous Coordinates SOLUTIONS & COMMENTARY

More on Transformations. COS 426, Spring 2019 Princeton University

2D Spline Curves. CS 4620 Lecture 13

Animation. CS 4620 Lecture 32. Cornell CS4620 Fall Kavita Bala

MTRX4700 Experimental Robotics

2D Spline Curves. CS 4620 Lecture 18

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

Quaternions and Rotations

CS612 - Algorithms in Bioinformatics

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Advanced Computer Graphics Transformations. Matthias Teschner

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Homogeneous Coordinates

Development of intelligent systems

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

Robot mechanics and kinematics

GEOMETRIC TOOLS FOR COMPUTER GRAPHICS

IntroductionToRobotics-Lecture02

Revision Problems for Examination 2 in Algebra 1

Early Fundamentals of Coordinate Changes and Rotation Matrices for 3D Computer Vision

CS4670/5670: Computer Vision Kavita Bala. Lecture 14: Feature matching and Transforms

Game Engineering: 2D

Vision Review: Image Formation. Course web page:

Linear transformations Affine transformations Transformations in 3D. Graphics 2009/2010, period 1. Lecture 5: linear and affine transformations

Robot mechanics and kinematics

Quaternions and Rotations

Math 462: Review questions

CS452/552; EE465/505. Geometry Transformations

METR Robotics Tutorial 2 Week 2: Homogeneous Coordinates

Affine Transformations in 3D

Visual Recognition: Image Formation

Agenda. Rotations. Camera models. Camera calibration. Homographies

Answers. Chapter 2. 1) Give the coordinates of the following points:

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

Overview. By end of the week:

Image warping , , Computational Photography Fall 2017, Lecture 10

Chapter 2 - Basic Mathematics for 3D Computer Graphics

Agenda. Perspective projection. Rotations. Camera models

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

Pipeline Operations. CS 4620 Lecture 14

Translations. Geometric Image Transformations. Two-Dimensional Geometric Transforms. Groups and Composition

CS6670: Computer Vision

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

Transcription:

Geometric Transformations CS 4620 Lecture 9 2017 Steve Marschner 1

A little quick math background Notation for sets, functions, mappings Linear and affine transformations Matrices Matrix-vector multiplication Matrix-matrix multiplication Implicit vs. explicit geometry 2017 Steve Marschner 2

Implicit representations Equation to tell whether we are on the curve Example: line (orthogonal to u, distance k from 0) (u is a unit vector) Example: circle (center p, radius r) {v (v p) (v p) r 2 =0} Always define boundary of region (if f is continuous) 2017 Steve Marschner 3

Explicit representations Also called parametric Equation to map domain into plane Example: line (containing p, parallel to u) Example: circle (center b, radius r) Like tracing out the path of a particle over time Variable t is the parameter 2017 Steve Marschner 4

Transforming geometry Move a subset of the plane using a mapping from the plane to itself Parametric representation: Implicit representation: 2017 Steve Marschner 5

Translation Simplest transformation: Inverse: Example of transforming circle 2017 Steve Marschner 6

Translation Simplest transformation: Inverse: Example of transforming circle 2017 Steve Marschner 6

Linear transformations One way to define a transformation is by matrix multiplication: Such transformations are linear, which is to say: (and in fact all linear transformations can be written this way) 2017 Steve Marschner 7

Geometry of 2D linear trans. 2x2 matrices have simple geometric interpretations uniform scale non-uniform scale rotation shear reflection Reading off the matrix 2017 Steve Marschner 8

Linear transformation gallery Uniform scale 2017 Steve Marschner 9

Linear transformation gallery Nonuniform scale 2017 Steve Marschner 10

Linear transformation gallery Rotation apple 0.866 0.5 0.5 0.866 2017 Steve Marschner 11

Linear transformation gallery Reflection can consider it a special case of nonuniform scale 2017 Steve Marschner 12

Linear transformation gallery Shear 2017 Steve Marschner 13

Composing transformations Want to move an object, then move it some more We need to represent S o T ( S compose T ) and would like to use the same representation as for S and T Translation easy Translation by ut then by us is translation by ut + us commutative! 2017 Steve Marschner 14

Composing transformations Linear transformations also straightforward Transforming first by M T then by M S is the same as transforming by M S M T only sometimes commutative e.g. rotations & uniform scales e.g. non-uniform scales w/o rotation Note M S M T, or S o T, is T first, then S 2017 Steve Marschner 15

Combining linear with translation Need to use both in single framework Can represent arbitrary seq. as e. g. Transforming by M T and u T, then by M S and u S, is the same as transforming by M S M T and u S + M S u T This will work but is a little awkward 2017 Steve Marschner 16

Homogeneous coordinates A trick for representing the foregoing more elegantly Extra component w for vectors, extra row/column for matrices for affine, can always keep w = 1 Represent linear transformations with dummy extra row and column 2017 Steve Marschner 17

Homogeneous coordinates Represent translation using the extra column 2017 Steve Marschner 18

Homogeneous coordinates Composition just works, by 3x3 matrix multiplication This is exactly the same as carrying around M and u but cleaner and generalizes in useful ways as we ll see later 2017 Steve Marschner 19

Affine transformations The set of transformations we have been looking at is known as the affine transformations straight lines preserved; parallel lines preserved ratios of lengths along lines preserved (midpoints preserved) 2017 Steve Marschner 20

Affine transformation gallery Translation 2017 Steve Marschner 21

Translation 2017 Steve Marschner 22

Translation 2017 Steve Marschner 22

Translation 2017 Steve Marschner 22

Translation 2017 Steve Marschner 22

Affine transformation gallery Uniform scale 2017 Steve Marschner 23

Affine transformation gallery Nonuniform scale 2017 Steve Marschner 24

Scaling 2017 Steve Marschner 25

Scaling 2017 Steve Marschner 25

Scaling 2017 Steve Marschner 25

Scaling 2017 Steve Marschner 25

Affine transformation gallery Rotation 2017 Steve Marschner 26

Rotation about z axis 2017 Steve Marschner 27

Rotation about z axis 2017 Steve Marschner 27

Rotation about x axis 2017 Steve Marschner 28

Rotation about x axis 2017 Steve Marschner 28

Rotation about y axis 2017 Steve Marschner 29

Rotation about y axis 2017 Steve Marschner 29

General Rotation Matrices A rotation in 2D is around a point A rotation in 3D is around an axis so 3D rotation is w.r.t a line, not just a point there are many more 3D rotations than 2D a 3D space around a given point, not just 1D convention: positive rotation is CCW convention: positive rotation is CCW when axis vector is pointing at you 2D 3D 2017 Steve Marschner 30

Euler angles An object can be oriented arbitrarily Euler angles: simply compose three coord. axis rotations e.g. x, then y, then z: heading, attitude, bank (common for airplanes) roll, pitch, yaw (common for vehicles) pan, tilt, roll (common for cameras) R( x, y, z )=R z ( z )R y ( y )R x ( x ) 2017 Steve Marschner 31

Euler angles An object can be oriented arbitrarily Euler angles: simply compose three coord. axis rotations e.g. x, then y, then z: heading, attitude, bank (common for airplanes) roll, pitch, yaw (common for vehicles) pan, tilt, roll (common for cameras) R( x, y, z )=R z ( z )R y ( y )R x ( x ) 2017 Steve Marschner 31

Euler angles in applications Wikipedia Ishikawa Watanabe Laboratory 2017 Steve Marschner 32

Affine transformation gallery Reflection can consider it a special case of nonuniform scale 2017 Steve Marschner 33

Affine transformation gallery Shear 2017 Steve Marschner 34

Properties of Matrices Translations: linear part is the identity Scales: linear part is diagonal Rotations: linear part is orthogonal Columns of R are mutually orthonormal: RR T =R T R=I Also, determinant of R is 1.0 [ det(r) = 1 ] 2017 Steve Marschner 35

General affine transformations The previous slides showed canonical examples of the types of affine transformations Generally, transformations contain elements of multiple types often define them as products of canonical transforms sometimes work with their properties more directly 2017 Steve Marschner 36

Composite affine transformations In general not commutative: order matters! rotate, then translate translate, then rotate 2017 Steve Marschner 37

Composite affine transformations In general not commutative: order matters! rotate, then translate translate, then rotate 2017 Steve Marschner 37

Composite affine transformations In general not commutative: order matters! rotate, then translate translate, then rotate 2017 Steve Marschner 37

Composite affine transformations In general not commutative: order matters! rotate, then translate translate, then rotate 2017 Steve Marschner 37

Composite affine transformations Another example scale, then rotate rotate, then scale 2017 Steve Marschner 38

Composite affine transformations Another example scale, then rotate rotate, then scale 2017 Steve Marschner 38

Composite affine transformations Another example scale, then rotate rotate, then scale 2017 Steve Marschner 38

Composite affine transformations Another example scale, then rotate rotate, then scale 2017 Steve Marschner 38

Rigid motions A transform made up of only translation and rotation is a rigid motion or a rigid body transformation The linear part is an orthonormal matrix Inverse of orthonormal matrix is transpose so inverse of rigid motion is easy: 2017 Steve Marschner 39

Composing to change axes Want to rotate about a particular point could work out formulas directly Know how to rotate about the origin so translate that point to the origin 2017 Steve Marschner 40

Composing to change axes Want to rotate about a particular point could work out formulas directly Know how to rotate about the origin so translate that point to the origin 2017 Steve Marschner 40

Composing to change axes Want to rotate about a particular point could work out formulas directly Know how to rotate about the origin so translate that point to the origin 2017 Steve Marschner 40

Composing to change axes Want to rotate about a particular point could work out formulas directly Know how to rotate about the origin so translate that point to the origin 2017 Steve Marschner 40

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2017 Steve Marschner 41

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2017 Steve Marschner 41

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2017 Steve Marschner 41

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2017 Steve Marschner 41

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2017 Steve Marschner 41

Composing to change axes Want to scale along a particular axis and point Know how to scale along the y axis at the origin so translate to the origin and rotate to align axes 2017 Steve Marschner 41

Transforming points and vectors Recall distinction points vs. vectors vectors are just offsets (differences between points) points have a location represented by vector offset from a fixed origin Points and vectors transform differently points respond to translation; vectors do not 2017 Steve Marschner 42

Transforming points and vectors Homogeneous coords. let us exclude translation just put 0 rather than 1 in the last place and note that subtracting two points cancels the extra coordinate, resulting in a vector! Preview: projective transformations what s really going on with this last coordinate? think of R 2 embedded in R 3 : all affine xfs. preserve z=1 plane could have other transforms; project back to z=1 2017 Steve Marschner 43

Transforming normal vectors Transforming surface normals differences of points (and therefore tangents) transform OK normals do not; therefore use inverse transpose matrix 2017 Steve Marschner 44

Transforming normal vectors Transforming surface normals differences of points (and therefore tangents) transform OK normals do not; therefore use inverse transpose matrix 2017 Steve Marschner 44

More math background Coordinate systems Expressing vectors with respect to bases Linear transformations as changes of basis 2017 Steve Marschner 45

Affine change of coordinates Six degrees of freedom or 2017 Steve Marschner 46

Affine change of coordinates Coordinate frame: point plus basis Interpretation: transformation changes representation of point from one basis to another Frame to canonical matrix has frame in columns takes points represented in frame represents them in canonical basis e.g. [0 0], [1 0], [0 1] Seems backward but bears thinking about 2017 Steve Marschner 47

Affine change of coordinates A new way to read off the matrix e.g. shear from earlier can look at picture, see effect on basis vectors, write down matrix Also an easy way to construct transforms e. g. scale by 2 across direction (1,2) 2017 Steve Marschner 48

Affine change of coordinates When we move an object to the canonical frame to apply a transformation, we are changing coordinates the transformation is easy to express in object s frame so define it there and transform it T e is the transformation expressed wrt. {e 1, e 2 } T F is the transformation expressed in natural frame F is the frame-to-canonical matrix [u v p] This is a similarity transformation 2017 Steve Marschner 49

Coordinate frame summary Frame = point plus basis Frame matrix (frame-to-canonical) is Move points to and from frame by multiplying with F Move transformations using similarity transforms 2017 Steve Marschner 50

Building transforms from points 2D affine transformation has 6 degrees of freedom (DOFs) this is the number of knobs we have to set to define one So, 6 constraints suffice to define the transformation handy kind of constraint: point p maps to point q (2 constraints at once) three point constraints add up to constrain all 6 DOFs (i.e. can map any triangle to any other triangle) 3D affine transformation has 12 degrees of freedom count them from the matrix entries we re allowed to change So, 12 constraints suffice to define the transformation in 3D, this is 4 point constraints (i.e. can map any tetrahedron to any other tetrahedron) 2017 Steve Marschner 51