Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 395/495-26: Spring 2003 IBMR: Week 1B 2-D Projective Geometry Jack Tumblin

Similar presentations


Presentation on theme: "CS 395/495-26: Spring 2003 IBMR: Week 1B 2-D Projective Geometry Jack Tumblin"— Presentation transcript:

1 CS 395/495-26: Spring 2003 IBMR: Week 1B 2-D Projective Geometry Jack Tumblin jet@cs.northwestern.edu

2 Recall: Scene & Image Light + 3D Scene: Illumination, shape, movement, surface BRDF,… Image Plane I(x,y) Angle( ,  ) Position(x,y) 2D Image: Collection of rays through a point GOAL: a Reversible Mapping Scene angles  image positions

3 View Interpolation: How? Chapter 2: 3D Projection (soon)Chapter 2: 3D Projection (soon) From a 3D scene Find new views of that scene view1 view2

4 View Interpolation: How? BUT FIRST, the simpler case Chapter 1: 2D ProjectionBUT FIRST, the simpler case Chapter 1: 2D Projection From a flat 2D image, Find new views of that image view1 view2

5 Answer: 2D Homogeneous Coords Chapter 1: 2D Projection From a flat 2D image, Find new views of that image view1 view2 Cartesian (x,y) coordinates in R 2 2D Homogeneous () coordinates in P 2 2D Homogeneous (x 1 x 2 x 3 ) coordinates in P 2

6 Overview Project 1: 1: Image-Colored Mesh ViewerProject 1: 1: Image-Colored Mesh ViewerProject 1:Project 1: Chapter 1: any 2D plane, as seen by any 3D camera view (texture mapping generalized)Chapter 1: any 2D plane, as seen by any 3D camera view (texture mapping generalized) Homogeneous Coordinates are WonderfulHomogeneous Coordinates are Wonderful Everything is a Matrix:Everything is a Matrix: –Conics (you can skip for now) –Aside: interpolation of pixels and points… Transform your Point of View: H matrixTransform your Point of View: H matrix Parts of H: useful kinds of TransformsParts of H: useful kinds of Transforms

7 2D Homogeneous Coordinates WHY? makes MUCH cleaner math!WHY? makes MUCH cleaner math! –Unifies lines and points –Puts perspective projection into matrix form –No divide-by-zero, lines at infinity defined… xy But in P 2, write same point x as where: (x,y) in R 2, write point x as xyxy x1x2x3x1x2x3 x = x 1 / x 3, y = x 2 / x 3, x 3 = anything non-zero! (but usually defaults to 1)

8 Homogeneous Coordinates WHAT?! Why Why ‘default’ value of 1? WHAT?! Why x 3 ? Why ‘default’ value of 1? Look at lines in R 2 :Look at lines in R 2 : –‘line’ == all (x,y) points where –scale by ‘k’  no change: Using ‘x 3 ’ for points UNIFIES notation:Using ‘x 3 ’ for points UNIFIES notation: –line is a 3-vector named l –now point (x,y) is a 3-vector too, named x ax + by + c = 0 kax + kby + kc = 0 ax + by + c = 0 = 0 x 1 x 2 x 3 abcabc x T. l = 0

9 Every Homog. point (x 1,x 2,x 3 ) describes a 3D rayEvery Homog. point (x 1,x 2,x 3 ) describes a 3D ray ‘Phantom’ dimension x 3 is the ‘z-buffer’ value‘Phantom’ dimension x 3 is the ‘z-buffer’ value 3D  2D ‘hard-wired’:3D  2D ‘hard-wired’: (Fig 1.1, pg 8) Homogeneous coords allows translation matrix:Homogeneous coords allows translation matrix: Useful 3D Graphics Ideas (0,0,-1) (x max, y max, -1) An ‘Ideal Point’ at (0,0,0) Center of Projection x y = 1 1 0 3 0 1 5 0 0 1 x+3y+51 ‘Image Plane’ (x,y,-1)

10 l 1  l 2 = x x 1  x 2 = l 2D Homogeneous Coordinates Important Properties 1 (see book for details) 3 coordinates, but only 2 degrees of freedom (only 2 ratios (x 1 / x 3 ), (x 2 / x 3 ) can change)3 coordinates, but only 2 degrees of freedom (only 2 ratios (x 1 / x 3 ), (x 2 / x 3 ) can change) DUALITY: points, lines are interchangeableDUALITY: points, lines are interchangeable –Line Intersections = point: (a 3D cross-product) (a 3D cross-product) –Point ‘Intersections’ = line: –Projective theorem for lines  theorem for points!

11 Homogeneous Coordinates Important Properties 2 (see book for details) Neatly Sidesteps ‘divide-by-zero’:Neatly Sidesteps ‘divide-by-zero’: –in (x,y) space (R 2 ) –Remember, we store (x 1,x 2, x 3 ) T, then compute (x 1 / x 3 ), (x 2 / x 3 ) only if OK. “OK, yeah, but so what?”...“OK, yeah, but so what?”...

12 Homogeneous Coordinates Why is deferring divide-by-zero so important? Why is deferring divide-by-zero so important? Cleanly Defines ‘Points at Infinity’ or ‘Ideal Points’ (x,y,0) TCleanly Defines ‘Points at Infinity’ or ‘Ideal Points’ (x,y,0) T –==outermost pixels (+/- , +/-  ) of an infinite image plane ((x,y), or R 2 ) –(x,y,0) is an entire plane of points in the (semi-bogus) 3D space (x 1,x 2, x 3 ) T space –but it is a ‘circle around infinity’ in (legit) P 2 projective space (x 1 /x 3, x 2 /x 3 ) T –Note! ‘Center of Projection’ is an ideal point. (Do outer limits of image plane ‘wrap around’ to that point?!?!)

13 Homogeneous Coordinates Why is deferring divide-by-zero so important? Why is deferring divide-by-zero so important? Cleanly defines one ‘Line at infinity’ l   (0,0,1) T, or “0x +0y +1=0” All ideal points are on l  : proof? l (x 1,x 2,0) T = 0All ideal points are on l  : proof? l (x 1,x 2,0) T = 0 All parallel lines Let l = (a,b,c) T and l’ = (a,b,c’) TAll parallel lines Let l = (a,b,c) T and l’ = (a,b,c’) T Any line l intersects with l  line at an ideal pointAny line l intersects with l  line at an ideal point Two parallel lines l and l’ always meet at an ideal point (page 7)Two parallel lines l and l’ always meet at an ideal point (page 7)

14 Homogeneous Coordinates Important Properties 3 (see book for details) Conic Sections (in the (x,y) plane, a.k.a. R 2 )Conic Sections (in the (x,y) plane, a.k.a. R 2 ) –SKIP this until a little later … –Core idea: Conics are Well-Behaved in the upcoming view-interpolations Elegant homogeneous matrix form for any and all conic curves (ellipse, circle, parabola, hyperbola, degenerate lines & points): Elegant homogeneous matrix form for any and all conic curves (ellipse, circle, parabola, hyperbola, degenerate lines & points): x T Cx = 0 Find any conic curve from just 5 (x,y) points on the curve’s image Find any conic curve from just 5 (x,y) points on the curve’s image Nice dual form exists too (analogous to line/point duality)! Nice dual form exists too (analogous to line/point duality)!

15 Homogeneous Coordinates Important Properties 4 (see book for details) View Interpolation (‘Projective Transform’)View Interpolation (‘Projective Transform’) –‘Central’ image plane (x,y,-1) T Choose a known point x’ Choose a known point x’ –Apply 3x3 Matrix H to (x,y,-1) T to make some OTHER plane Ray through known point x’ pierces unknown point x Ray through known point x’ pierces unknown point x (0,0,-1) ‘Image Plane’ (x,y,-1) (x,y,-1) (0,0,0) x` x x1x2x3x1x2x3 h 11 h 12 h 13 h 21 h 22 h 21 h 31 h 32 h 33 = x’ 1 x’ 2 x’ 3 H x’ = x 3D world plane

16 H matrix: Plane-to-Plane mapping What if H is unknown, but we have four or more pairs of x,x’ points? (see pg 15) x 1, x 2, x 3, x 4, x’ 1, x’ 2, x’ 3, x’ 4 … Projective Transform H (0,0,-1) ‘Image Plane’ (x,y,-1) (x,y,-1) (0,0,0) x` x x1x1x2x2x3x3x1x1x2x2x3x3 h 11 h 12 h 13 h 21 h 22 h 21 h 31 h 32 h 33 = x’ 1 x’ 2 x’ 3 H x’ = x

17 Projective Transform H x1x1x2x2x3x3x1x1x2x2x3x3 h 11 h 12 h 13 h 21 h 22 h 21 h 31 h 32 h 33 = x’ 1 x’ 2 x’ 3 H x’ = x Finding H from point pairs (correspondences) We know that Hx’ = x, andWe know that Hx’ = x, and we know at least 4 point pairs x’ and x that satisfy it:we know at least 4 point pairs x’ and x that satisfy it: ATTEMPT 1: ‘plug & chug’: make a matrix of x and x’ values…ATTEMPT 1: ‘plug & chug’: make a matrix of x and x’ values… H = x’ 1 x’ 2 x’ 3 x’ 4 x1x1x1x1 x2x2x2x2 x3x3x3x3 x4x4x4x4

18 Projective Transform H x1x1x2x2x3x3x1x1x2x2x3x3 h 11 h 12 h 13 h 21 h 22 h 21 h 31 h 32 h 33 = x’ 1 x’ 2 x’ 3 H x’ = x Finding H from point pairs (correspondences) We know that Hx’ = x, andWe know that Hx’ = x, and we know at least 4 point pairs x’ and x that satisfy it:we know at least 4 point pairs x’ and x that satisfy it: ATTEMPT 1: ‘plug & chug’ make a matrix of x and x’ values…ATTEMPT 1: ‘plug & chug’ make a matrix of x and x’ values… H = x’ 1 x’ 2 x’ 3 x’ 4 x1x1x1x1 x2x2x2x2 x3x3x3x3 x4x4x4x4 UNKNOWN!

19 END


Download ppt "CS 395/495-26: Spring 2003 IBMR: Week 1B 2-D Projective Geometry Jack Tumblin"

Similar presentations


Ads by Google