B4 Computational Geometry



Similar documents
Essential Mathematics for Computer Graphics fast

3D Tranformations. CS 4620 Lecture 6. Cornell CS4620 Fall 2013 Lecture Steve Marschner (with previous instructors James/Bala)

Introduction to Computer Graphics Marie-Paule Cani & Estelle Duveau

2D Geometrical Transformations. Foley & Van Dam, Chapter 5

Geometric Camera Parameters

w = COI EYE view direction vector u = w ( 010,, ) cross product with y-axis v = w u up vector

Affine Transformations

Lecture 2: Homogeneous Coordinates, Lines and Conics

Geometric Transformation CS 211A

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

Identifying second degree equations

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

Math 241, Exam 1 Information.

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Name Class. Date Section. Test Form A Chapter 11. Chapter 11 Test Bank 155

Projective Geometry: A Short Introduction. Lecture Notes Edmond Boyer

Projective Geometry. Projective Geometry

Metrics on SO(3) and Inverse Kinematics

Exam 1 Sample Question SOLUTIONS. y = 2x

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

Linear Equations in Linear Algebra

Two vectors are equal if they have the same length and direction. They do not

The Essentials of CAGD

1.5 SOLUTION SETS OF LINEAR SYSTEMS

(a) We have x = 3 + 2t, y = 2 t, z = 6 so solving for t we get the symmetric equations. x 3 2. = 2 y, z = 6. t 2 2t + 1 = 0,

Rotation Matrices and Homogeneous Transformations

11.1. Objectives. Component Form of a Vector. Component Form of a Vector. Component Form of a Vector. Vectors and the Geometry of Space

521493S Computer Graphics. Exercise 2 & course schedule change

Section 1.1. Introduction to R n

Connecting Transformational Geometry and Transformations of Functions

TWO-DIMENSIONAL TRANSFORMATION

A QUICK GUIDE TO THE FORMULAS OF MULTIVARIABLE CALCULUS

Notes on the representational possibilities of projective quadrics in four dimensions

Advanced Computer Graphics (2IV40) ~ 3D Transformations. Types (geometric) Types (algebraic) 3D Transformations. y + c 1. x = a 1.

Interactive Computer Graphics

12.5 Equations of Lines and Planes

5. Orthogonal matrices

ISOMETRIES OF R n KEITH CONRAD

Section 11.4: Equations of Lines and Planes

Metric Measurements on a Plane from a Single Image

Computer Animation. Lecture 2. Basics of Character Animation

Given a point cloud, polygon, or sampled parametric curve, we can use transformations for several purposes:

Modeling Curves and Surfaces

Number Sense and Operations

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

2.1 Three Dimensional Curves and Surfaces

Introduction to Computer Graphics

Kinematics of Robots. Alba Perez Gracia

LINES AND PLANES CHRIS JOHNSON

THEORETICAL MECHANICS

2D Geometric Transformations

Kinematical Animation

TEXTURE AND BUMP MAPPING

Equations Involving Lines and Planes Standard equations for lines in space

Solution Guide III-C. 3D Vision. Building Vision for Business. MVTec Software GmbH

Chapter 6. Orthogonality

Path Tracking for a Miniature Robot

THE CONGRUENT NUMBER PROBLEM

Geometry for Computer Graphics

Numerical Analysis Lecture Notes

Solving Simultaneous Equations and Matrices

Mathematics (MAT) MAT 061 Basic Euclidean Geometry 3 Hours. MAT 051 Pre-Algebra 4 Hours

Geometry Course Summary Department: Math. Semester 1

Summary: Transformations. Lecture 14 Parameter Estimation Readings T&V Sec Parameter Estimation: Fitting Geometric Models

L 2 : x = s + 1, y = s, z = 4s Suppose that C has coordinates (x, y, z). Then from the vector equality AC = BD, one has

α = u v. In other words, Orthogonal Projection

Determine whether the following lines intersect, are parallel, or skew. L 1 : x = 6t y = 1 + 9t z = 3t. x = 1 + 2s y = 4 3s z = s

Math for Game Programmers: Dual Numbers. Gino van den Bergen

9 MATRICES AND TRANSFORMATIONS

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

Section 1.4. Lines, Planes, and Hyperplanes. The Calculus of Functions of Several Variables

Inner Product Spaces and Orthogonality

Fundamentals of Computer Animation

GRADES 7, 8, AND 9 BIG IDEAS

Epipolar Geometry. Readings: See Sections 10.1 and 15.6 of Forsyth and Ponce. Right Image. Left Image. e(p ) Epipolar Lines. e(q ) q R.

CS 4620 Practicum Programming Assignment 6 Animation

Mechanics lecture 7 Moment of a force, torque, equilibrium of a body

x y The matrix form, the vector form, and the augmented matrix form, respectively, for the system of equations are

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Human-like Arm Motion Generation for Humanoid Robots Using Motion Capture Database

CS 4204 Computer Graphics

CS 4204 Computer Graphics

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

Relating Vanishing Points to Catadioptric Camera Calibration

discuss how to describe points, lines and planes in 3 space.

Lecture notes on linear algebra

Surface Normals and Tangent Planes

3. Let A and B be two n n orthogonal matrices. Then prove that AB and BA are both orthogonal matrices. Prove a similar result for unitary matrices.

SOLID MECHANICS TUTORIAL MECHANISMS KINEMATICS - VELOCITY AND ACCELERATION DIAGRAMS

FURTHER VECTORS (MEI)

1 VECTOR SPACES AND SUBSPACES

Week 1 Chapter 1: Fundamentals of Geometry. Week 2 Chapter 1: Fundamentals of Geometry. Week 3 Chapter 1: Fundamentals of Geometry Chapter 1 Test

CIS 536/636 Introduction to Computer Graphics. Kansas State University. CIS 536/636 Introduction to Computer Graphics

Lecture 7. Matthew T. Mason. Mechanics of Manipulation. Lecture 7. Representing Rotation. Kinematic representation: goals, overview

Curriculum Map by Block Geometry Mapping for Math Block Testing August 20 to August 24 Review concepts from previous grades.

BEZIER CURVES AND SURFACES

Big Ideas in Mathematics

Common Core Unit Summary Grades 6 to 8

Transcription:

3CG 2006 / B4 Computational Geometry David Murray david.murray@eng.o.ac.uk www.robots.o.ac.uk/ dwm/courses/3cg Michaelmas 2006

3CG 2006 2 / Overview Computational geometry is concerned with the derivation of techniques the design of efficient algorithms and the construction of effective representations for geometric computation. Techniques from computational geometry are used in: Computer Graphics Computer Aided Design Computer Vision Robotics

3CG 2006 3 / Topics Lecture : Euclidean, similarity, affine and projective transformations. Homogeneous coordinates and matrices. Coordinate frames. Perspective projection and its matri representation. Lecture 2: Perspective projection and its matri representation. Vanishing points. Applications of projective transformations. Lecture 3: Conveity of point-sets, conve hull and algorithms. Conics and quadrics, implicit and parametric forms, computation of intersections. Lecture 4: Bezier curves, B-splines. Tensor-product surfaces.

3CG 2006 4 / Useful Tets Bartels, Beatty and Barsky, An introduction to splines for use in computer graphics and geometric modeling, Morgan Kaufmann, 987. Everything you could want to know about splines. Fau and Pratt, Computational geometry for design and manufacture, Ellis Horwood, 979. Good on curves and transformations. Farin, Curves and Surfaces for Computer-Aided Geometric Design : A Practical Guide, Academic Press, 996. Foley, van Dam, Feiner and Hughes, Computer graphics - principles and practice, Addison Wesley, second edition, 995. The computer graphics book. Covers curves and surfaces well. Hartley and Zisserman Multiple View Geometry in Computer Vision, CUP, 2000. Chapter is a good introduction to projective geometry. O Rourke, Computational geometry in C, CUP, 998. Very straightforward to read, many eamples. Highly recommended. Preparata and Shamos, Computational geometry, an introduction, Springer-Verlag, 985. Very formal and complete for particular algorithms.

5/ 3CG 2006 Eample I: Virtual Reality Models from Images Input: Four overlapping aerial images of the same urban scene Objective: Teture mapped 3D models of buildings

3CG 2006 6 / Eample II: Video Mosaicing

3CG 2006 7 / Eample II: Video Mosaicing

3CG 2006 8 / Eample II: Video Mosaicing

3CG 2006 9 / Lecture. Lecture : Transformations, Homogeneous Coordinates, and Coordinate Frames Euclidean, similarity, affine and projective transformations. Homogeneous coordinates and matrices. Coordinate frames.

3CG 2006 0 / Hierarchy of transformations We will look at linear transformations represented by matrices of increasing generality: Euclidean Similarity Affine Projective We consider both 2D 2D mappings ( plane to plane mappings); and 3D 3D transformations

3CG 2006 / Class I: Euclidean transformations: translation & rotation. Translation 2 dof in 2D ( ) ( ) ( ) t y = + y t y y t t 2. Rotation dof in 2D ( ) [ cos θ sin θ y = sin θ cos θ ] ( y ) θ O y θ O In vector notation, a Euclidean transformation is written = R + t R is the orthogonal rotation matri, RR = I, and etc are column vectors.

3CG 2006 2 / Build transformations in steps... Often useful to introduce intermediate coordinate frames. For eample: Object model described in body-centered frame B Pose (θ, t) of model frame given w.r.t. world frame W Where is B in W? y B y W y y Model B A B B t W θ A ( ) cos θ sin θ In an aligned frame A = sin θ cos θ B. Check using the point (, 0). It should be (+ cos θ, + sin θ) in the A frame. Then W = A + t Origin of B in W. Check the above using the origin of A. It should be t OBW in W frame...

3CG 2006 3 / In 3D... In 3D the transformation X = R 3 3 X + T has 6 dof. Two major ways of representing 3 rotation rotation about successive new aes: eg ZYX Euler angles rotation about old fied aes : eg ZXY roll-pitch-yaw In each case the order is important, as rotations do not commute. X W = X = X 2 = cos p sin p 0 sin p cos p 0 0 0 cos e 0 sin e 0 0 sin e 0 cos e 0 0 0 cos c sin c 0 sin c cos c X X 2 X B z 2 z 2 e e c p y z B y W z 2 p W y B c y 2

3CG 2006 4 / Rotation about old fied aes : eg ZXY roll-pitch-yaw Y Y X X Start Z Z Roll about ORIG Z Y Y X X Z Pitch about orig X Z Yaw about orig Y

3CG 2006 5 / Class II: Similarity transformations A Euclidean transformation is an isometry an action that preserves lengths and angles. Apply an isotropic scaling s to an isometry isotropic scaling and you ll arrive at a similarity transformation. A similarity had 4 degrees of freedom in 2D = sr + t A similarity preserves ratios of lengths ratios of areas, and angles. It is the most general transformation that preserves shape.

3CG 2006 6 / Class III: Affine transformations An affine transformation (6 degrees of freedom in 2D) is a non-singular linear transformation followed by a translation: ( ) y = with A a 2 2 non-singular matri. In vector form: A ( y = A + t Angles and length ratios are not preserved. ) ( ) t + t y How many points required to determine an affine transform in 2D?

3CG 2006 7 / Eamples of affine transformations Both the previous classes: Euclidean, similarity. 2 Scalings in the and y directions [ ] µ 0 A = 0 µ 2 This is non-isotropic if µ =µ 2. 3 If A is a symmetric matri. then A can be decomposed as: (it s an eigen-decomposition) [ ] [ ] [ ] A = R D R cos θ sin θ λ 0 cos θ sin θ = sin θ cos θ 0 λ 2 sin θ cos θ where λ and λ 2 are its eigenvalues. i.e. scalings in two dirns rotated by θ.

3CG 2006 8 / Affine transformations map parallel lines to... Always useful to think what is preserved in a transformation... A (λ) = a + λd B (λ) = b + µd = A + t A(λ) = A(a + λd) + t = (Aa + t) + λ(ad) = a + λd B(µ) = A(b + µd) + t = (Ab + t) + µ(ad) = b + µd Lines are still parallel they both have direction d. Affine transformations also preserve... λ = 0 a µ = 0 b λ µ d d

3CG 2006 9 / Homogeneous notation motivation If the translation t is zero, then transformations can be concatenated by simple matri multiplication: = A and 2 = A 2 THEN 2 = A 2 A However, if the translation is non-zero it becomes a mess = A + t 2 = A 2 + t 2 = A 2 (A + t ) + t 2 = (A 2 A ) + (A 2 t + t 2 ) ( ) If instead 2D points are represented by a three vector y y then the transformation can be represented by a 3 3 matri...

3CG 2006 20 / Homogeneous notation The matri has block form: ( ) = [ A t 0 ] ( a a 2. t ) = a 2 a 22. t y.......... 0 0. y... = ( A + t Transformations can now ALWAYS be concatenated by matri multiplication ( ) [ ] ( ) ( ) A t A + t = 0 = ( ) [ ] ( ) [ ] [ ] ( ) 2 A2 t 2 A2 t 2 A t = 0 = 0 0 [ ] ( ) ( ) A2 A A 2 t + t 2 (A2 A = 0 = ) + (A 2 t + t 2 ) )

3CG 2006 2 / Homogeneous notation definition = (, y) is represented in homogeneous coordinates by any 3-vector 2 3 such that = / 3 y = 2 / 3 So the following homogeneous vectors represent the same point for any λ=0. λ 2 3 and λ 2 λ 3 For eample, the homogeneous vectors (2, 3, ) and (4, 6, 2) represent the same inhomogeneous point (2, 3)

3CG 2006 22 / Homogeneous notation rules for use Then the rules for using homogeneous coordinates for transformations are. Convert the inhomogeneous point to an homogeneous vector: ( y ) y 2. Apply the 3 3 matri transformation. 3. Dehomogenise the resulting vector: 2 3 ( ) / 3 2 / 3 NB the matri needs only to be defined up to scale. E.g. 2 3 4 5 6 0 0 and 2 4 6 8 0 2 0 0 2 represent the SAME 2D affine transformation Think about degrees of freedom...

3CG 2006 23 / Homogeneous notation for R 3 A point X = X Y Z is represented by a homogeneous 4-vector: X X 2 X 3 X 4 such that X = X X 4 Y = X 2 X 4 Z = X 3 X 4

3CG 2006 24 / Eample: The Euclidean transformation in 3D X = RX + T where R is a 3 3 rotation matri, and T a translation 3-vector, is represented as X [ ] X [ ] ( ) X 2 R T X 3 = Y R T X 0 Z = 0 X 4 4 4 with X = X Y Z = X 4 X X 2 X 3

3CG 2006 25 / Application to coordinate frames: Eg - stereo cameras R L W ( XR ) = [ RRW T RW 0 ] ( XW ) ( XL ) = [ RLW T LW 0 ] ( XW ) Then ( XR ) = [ RRW T RW 0 ] [ RLW T LW 0 ] ( XL ) = [ 4 4 ] ( XL )

3CG 2006 26 / Application to coordinate frames: Eg - Puma robot arm Link 3 Link 2 Links 4,5,6 Link Base Frame Tool Frame Kinematic chain: ( ) [ ] [ XT RT6 T T6 R32 0 = 0... 0 [ ] ( ) 4 4 XB = ] [ R2 T 2 0 ] [ RB T B 0 ] ( X

3CG 2006 27 / A note on the inverse... It must be the case that [ RAB T AB 0 ] = [ RBA T BA 0 ] Now, we know that but what is T BA? Tempting to say T AB, but no. R BA = R AB X A = R AB X B + T AB (T AB is Origin of B in A) X B = R BA (X A T AB ) X B = R BA X A R BA T AB BUT X B = R BA X A + T BA (T BA is Origin of A in B) T BA = R BA T AB

3CG 2006 28 / Class IV: Projective transformations A projective transformation is a linear transformation on homogeneous n-vectors represented by a non-singular n n matri. In 2D 2 3 = h h 2 h 3 h 2 h 22 h 23 h 3 h 32 h 33 Note the difference from an affine transformation is only in the first two elements of the last row. In inhomogeneous (normal) notation, a projective transformation is a non-linear map = 3 = h + h 2 y + h 3, y = 2 h 3 + h 32 y + h 33 3 = h 2 + h 22 y + h 23 h 3 + h 32 y + h 33 The 3 3 matri has 8 dof... 2 3

3CG 2006 29 / Class IV: 3D-3D Projective transformations In 3D X X 2 X 3 X 4 = p p 2 p 3 p 4 p 2 p 22 p 23 p 24 p 3 p 32 p 33 p 34 p 4 p 42 p 43 p 44 X X 2 X 3 X 4 The 4 4 matri has 5 dof...

3CG 2006 30 / Perspective is a subclass of projective transformation

3CG 2006 3 / Perspective (central) projection 3D to 2D Mathematical idealized camera 3D 2D Image coordinates y Camera frame XYZ (origin at optical centre) Focal length f, image plane is at Z = f. Use similar triangles f = X Z y f = Y Z or = f X Z where and X are 3-vectors, with = (, y, f ), X = (X, Y, Z ). O Y f X f y y image plane Z Z X Y

3CG 2006 32 / Eamples Circle in space, orthogonal to and centred on the Z -ais: Y X X(θ) = (a cos θ, a sin θ, Z ) a (θ) = ( fa Z cos θ, fa Z sin θ, f ) Z (, y) = fa (cos θ, sin θ) Z Image is a circle of radius fa/z inverse distance scaling Now move circle in X direction: that is, to X (θ) = (a cos θ + X 0, a sin θ, Z ) Eercise: What happens to the image? Is it still a circle? Is it larger or smaller?

3CG 2006 33 / Eamples ctd/ Sphere concentric with Z -ais: Y X Z grazing cone rays Intersection of cone with image plane is a circle. Eercise: Now move sphere in the X direction. What happens to the image?

3CG 2006 34 / The Homogeneous 3 4 Projection Matri In inhomogeneous coords = f X/Z Choose f = from now on. O Y f X y Z X Homogeneous image coordinates (, 2, 3 ) represent = X/Z if X 0 0 0 ( ) 2 = 0 0 0 Y X Z = [I 0] 3 0 0 0 Check that = / 3 = X/Z y = 2 / 3 = Y /Z Then perspective projection is a linear map, represented by a 3 4 projection matri, from 3D to 2D.

3CG 2006 35 / Eample: a 3D point Non-homogeneous X Y Z (, y) = (6/2, 4/2) = (3, 2). = 6 4 2 is imaged at In homogeneous notation using 3 4 projection matri: 6 λ 0 0 0 λy = 2 = 0 0 0 4 6 2 = 4 λ 3 0 0 0 2 which is the 2D inhomogeneous point (, y) = (3, 2).

3CG 2006 36 / Suppose scene is describe in a World coord frame ( XC The Euclidean transformation between the camera and world coordinate frames is X C = RX W + T: ) = [ R T 0 ] ( XW ) XC OC YC Z C R, T O W ZW Y W Concatenating the two matrices... 2 = 0 0 0 [ 0 0 0 R T 0 3 0 0 0 ] ( XW ) X W ( XW = [ R T] ) which defines the 3 4 projection matri P = [R T] from a Euclidean World coordinate frame to an image.

3CG 2006 37 / Suppose scene described as set of Objects and Poses Now each 3D object O is described in it own Object frame... Each Object frame is given a Pose [R o, T o ] relative to World frame... Cameras are placed at [R c, T c ] relative to world frame... ( c ) = K c 0 0 0 0 0 0 0 0 0 [ Rc T c 0 ] [ Ro T o 0 ] ( Xo ) 3 3 matri K c allows each camera to have a different focal length etc... You can now do 3D computer graphics...

3CG 2006 38 / Isn t every projective transform a perspective projection? A projective trans followed by a projective trans is a... So a perspective trans followed by a perpspective trans is a... A C B B C A

3CG 2006 38 / Isn t every projective transform a perspective projection? A projective trans followed by a projective trans is a... So a perspective trans followed by a perpspective trans is a... A B C A C B B C A

3CG 2006 38 / Isn t every projective transform a perspective projection? A projective trans followed by a projective trans is a... So a perspective trans followed by a perpspective trans is a... A B C A C B B C A