Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 395/495-26: Spring 2003 IBMR: Week 5 A Back to Chapter 2: 3 -D Projective Geometry Jack Tumblin

Similar presentations


Presentation on theme: "CS 395/495-26: Spring 2003 IBMR: Week 5 A Back to Chapter 2: 3 -D Projective Geometry Jack Tumblin"— Presentation transcript:

1 CS 395/495-26: Spring 2003 IBMR: Week 5 A Back to Chapter 2: 3 -D Projective Geometry Jack Tumblin jet@cs.northwestern.edu

2 IBMR-Related Seminars 3D Scanning for Cultural Heritage Applications 3D Scanning for Cultural Heritage Applications Holly Rushmeier, IBM TJ Watson 3D Scanning for Cultural Heritage Applications Friday May 16 3:00pm, Rm 381, CS Dept. no title yet... no title yet... Steve Marschner, Cornell University Friday May 23 3:00pm, Rm 381, CS Dept.

3 3D Homogeneous Coordinates Extend Projective space from 2D to 3D: P 2 :P 2 : –From 2D ‘world space’ (x,y) make –2D homogeneous coordinates (x 1,x 2,x 3 ). –2D projective ‘image space’ (x’,y’) = (x 1 /x 3, x 2 /x 3 ) P 3 :P 3 : –From 3D ‘world space’ (x,y,z) make –3D homogeneous coordinates (x 1,x 2,x 3,x 4 ). –3D projective ‘image space’ (x’,y’,z’) = (x 1 /x 4, x 2 /x 4, x 3 /x 4 )

4 3D Homogeneous Coordinates –Unifies points and planes –(but lines are messy) –Puts perspective projection into matrix form –No divide-by-zero, points at infinity defined… x y But in P 3, write same point x as: where: (x,y,z) in R 3, write point x as xyzxyz x1x2x3x4x1x2x3x4 x = x 1 / x 4, y = x 2 / x 4, z = x 3 / x 4, x 4 = anything non-zero! (but usually defaults to 1) z

5 A Very Common Mistaek: P 2 homog. coords: 2D projective map (2D point  3D ray is correct)P 2 homog. coords: 2D projective map (2D point  3D ray is correct) P 3 homog. coords. 3D projective map ( But 3D point  3D ray’ is WRONG!)P 3 homog. coords. 3D projective map ( But 3D point  3D ray’ is WRONG!) x2x2x2x2 x1x1x1x1 x2x2x2x2 x1x1x1x1 x3x3x3x3 (x,y) (x 1, x 2, x 3 ) (x,y,z) (x 1, x 2, x 3, x 4 )

6 A Very Common Mistaek P 2 homog. coords: 2D projective map (2D point  3D ray)P 2 homog. coords: 2D projective map (2D point  3D ray) P 3 homog. coords. 3D projective map ( 3D point  3D ray’ is WRONG!)P 3 homog. coords. 3D projective map ( 3D point  3D ray’ is WRONG!) x2x2x2x2 x1x1x1x1 x2x2x2x2 x1x1x1x1 x3x3x3x3 (x,y,z) (x,y) (x 1, x 2, x 3 ) (x,y,z) (x 1, x 2, x 3, x 4 ) NO! Don’t confuse 3D ‘z’ with projective x 4 !

7 P 3 : Point  Plane duality Recall Plane Equations in 3D: Normal vector: (a,b,c) = n Unaffected by scale k, with Min. Distance from plane to origin: d Write in 3D homog. coordinates: Point x and Plane  are duals (lines are not!) ax + by + cz +d = 0 kax + kby + kcz + kd= 0 = 0 x 1 x 2 x 3 x 4 abcdabcd x T.  = 0 ax + by + cz +d = 0 ^

8 3D Homogeneous Coordinates P 2 homog. coords: 2D projective map (2D point  3D ray)P 2 homog. coords: 2D projective map (2D point  3D ray) P 3 homog. coords. 3D projective map 3D point  4D ‘ray’: --an impossible-to-draw plane in R 4 with normal x1,x2,x3 --its 3D part is a ray through originP 3 homog. coords. 3D projective map 3D point  4D ‘ray’: --an impossible-to-draw plane in R 4 with normal x1,x2,x3 --its 3D part is a ray through origin x2x2x2x2 x1x1x1x1 x2x2x2x2 x1x1x1x1 x3x3x3x3 (x,y,z) (x,y) (x 1, x 2, x 3 ) (x,y,z) (x 1, x 2, x 3, x 4 ) x3x3x3x3 (Approx. as many 2D planes of constant z) (One 2D plane of constant z)

9 3D Homogeneous Coordinates P 3 homog. coords. 3D projective map 3D point  4D ‘ray’: --Superset of P 2 transformations: --Includes translation, projection from any point x2x2x2x2 x1x1x1x1 x3x3x3x3 (x,y,z) (x,y,z) (x 1, x 2, x 3, x 4 ) (Approx. as many 2D planes of constant z) H (x 1 ’, x 2 ’, x 3 ’, x 4 ’) x2x2x2x2 x1x1x1x1 x3x3x3x3

10 Find plane  thru points P 1,P 2,P 3 ?Find plane  thru points P 1,P 2,P 3 ? –Easy! Stack points: –Find null space (SVD) –(Rank 2? collinear points!) OR: use 3D cross products:OR: use 3D cross products: Points  Plane Conversions PT1PT1PT2PT2PT3PT3PT1PT1PT2PT2PT3PT3 = 0  p 11 p 12 p 13 p 14 p 21 p 22 p 23 p 24 p 31 p 32 p 33 p 34 1122334411223344 = 0  = (p1 – p3)  (p2-p3) – x3(x1  x2) – x3(x1  x2) (p 1 - p 3 )  (p 2 - p 3 ) -p 3 T · ( p 1  p 2 )  = = = = (scalar)

11 Plane  can define a 3D coordinate system (find u,v coordinates within plane, w along plane normal) –Because  is equiv. to plane’s normal vector –Find 3  vectors in P3 (null space of [0 0 0  ] ) –assemble them as columns of 4x3 M vector –To get 3D coords of any P 3 point p: M p = x’ –Finds a 2D coords in P 2 plane (of  ): x’ = Points  Planes in P 3 uvw

12 Lines in P 3 : Awkward Geometrically, Lines are:Geometrically, Lines are: –Intersection of 2 (or more) planes, –An axis or ‘pencil’ of planes, –Linear combo of 2 points, p 1 + A(p 2 -p 1 ) –a 4 DOF entity in P 3 ; a 4-vector won’t do! Symbolically: Three forms of P 3 lines:Symbolically: Three forms of P 3 lines: –‘Span’ : Null Space of matrix W –Plűcker Matrix –Plűcker Line Coordinates

13 Recall that a point x is on a plane  iffRecall that a point x is on a plane  iff if 2 given points A, B intersect with a ‘pencil’ of planes on a line,if 2 given points A, B intersect with a ‘pencil’ of planes on a line, Define a ‘P3 line’ as that intersection: stack A T, B T to make 2x4 matrix W:Define a ‘P3 line’ as that intersection: stack A T, B T to make 2x4 matrix W: W = If line W contains the plane , then W  = 0If line W contains the plane , then W  = 0 P 3 Lines 1a: ( Point-Point ) Span W a 1 a 2 a 3 a 4 b 1 b 2 b 3 b 4 A B x T.  = 0 T.  = 0 AB

14 P 3 Lines 1b: ( Plane-Plane ) Span W* Recall that a point x is on a plane  ifRecall that a point x is on a plane  if If 2 given planes P,Q intersect at a ‘pencil’ of points on a line,If 2 given planes P,Q intersect at a ‘pencil’ of points on a line, Define a ‘P3 line’ as that intersection: stack P T, Q T to make 2x4 matrix W*:Define a ‘P3 line’ as that intersection: stack P T, Q T to make 2x4 matrix W*: W* = If line W* contains the point x, then W* x = 0If line W* contains the point x, then W* x = 0 p 1 p 2 p 3 p 4 q 1 q 2 q 3 q 4 x T.  = 0 P Q x T. PQ = 0

15 P 3 Lines 1:Spans (Point) Span W(Point) Span W –(Found from points A,B) –Used to test plane  : (Plane) Span W*(Plane) Span W* –(Found from planes P,Q) –Used to test point x : P Q A B W T W* = W* W T = 0 2x2 (the 2x2 null matrix) W  = 0 W* x = 0 Useful property:

16 P 3 Lines 1: ‘Join’ reverses Spans... Join Line W and Point p  Plane Join Line W and Point p  Plane  W  = 0 iff plane  holds line W, and p T  = 0 iff plane  holds point p; stack … Let M = ; solve for  in M  = 0 W  = 0 iff plane  holds line W, and p T  = 0 iff plane  holds point p; stack … Let M = ; solve for  in M  = 0 Join Line W* and Plane   Point pJoin Line W* and Plane   Point p W* p = 0 iff line W* holds point p  p = 0 iff plane  holds point p; stack… W* p = 0 iff line W* holds point p  p = 0 iff plane  holds point p; stack… Let M* = ; solve for p in M* p = 0 W WWpTpTWWpTpT W*

17 P 3 Lines 2: Plűcker Matrices Line == A 4x4 symmetric matrix, rank 2, 4DOF Line L through known points A, B:Line L through known points A, B: L = A. B T - B. A T = Line L* through known planes P,Q:Line L* through known planes P,Q: L* = P. Q T – QP T a 1 a 2 a 3 a 4 b 1 b 2 b 3 b 4 a1a2a3a4a1a2a3a4a1a2a3a4a1a2a3a4 b1b2b3b4b1b2b3b4b1b2b3b4b1b2b3b4 - P Q A B Two forms:

18 P 3 Lines 2: Plűcker Matrices Line == A 4x4 symmetric matrix, rank 2, 4DOF Line L through A, B pts: L = A. B T - B. A TLine L through A, B pts: L = A. B T - B. A T Line L* through P,Q planes: L* = P. Q T - QP TLine L* through P,Q planes: L* = P. Q T - QP T L  L* convert? Note that:L  L* convert? Note that: –Skew-symmetric; –L’s has 6 params: or –Note det|L|=0 is written l 12 l 34 + l 13 l 42 +l 14 l 23 = 0 –Simple! Replace l ij with l mn so that {i,j,m,n} = {1,2,3,4} Examples: l 12  l 34,or l 42  l 13 etc.  l 12 l 13 l 14  l 23 l 24  l 34   l 12 l 13 l 14   l 23 l 24    l 34      l 12 l 13 l 14  l 23   l 34  l 42   l 12 l 13 l 14   l 23     l 34  l 42   (to avoid minus signs)

19 P 3 Lines 2: Plűcker Matrices Join Line L* and Point p  Plane Join Line L* and Point p  Plane  L*. p =  (if point is on the line, then L*. p = 0 ) L*. p =  (if point is on the line, then L*. p = 0 ) Join Line L and Plane   Point p L.  = p L.  = p (if line is in the plane, then L.  =0 ) (if line is in the plane, then L.  =0 )

20 P 3 Lines 3: Plűcker Line Coords ==Plűcker Matrix has 6 vital elements: –Off-diagonals or –Just make them a 6-vector: and require that det|L| = 0, or:  l 12 l 13 l 14  l 23 l 24  l 34   l 12 l 13 l 14   l 23 l 24    l 34      l 12 l 13 l 14  l 23   l 34  l 42   l 12 l 13 l 14   l 23     l 34  l 42   (to avoid minus signs) L = l 12 l 13 l 14 l 23 l 42 l 34 l 12 l 34 + l 13 l 42 +l 14 l 23 = 0

21 Projective Transformations Use H for transforms in P 3 : Use H for transforms in P 3 : –Has 15 DOF (4x4 -1) –Superset of the P 2 H matrix: Homework Hint: ProjA show P 2 objects in R 3 ProjA show P 2 objects in R 3 x 1  x,x 2  y,x 3  z; uses  h 11 h 12 h 13 h 21 h 22 h 21 h 31 h 32 h 33 h 11 h 12 0 h 13 h 21 h 22 0 h 23 0 0 0 0 h 31 h 32 0 h 33 h 11 h 12 h 13 h 14 h 21 h 22 h 23 h 24 h 31 h 32 h 33 h 34 h 41 h 42 h 43 h 44 H = H2 =H2 =H2 =H2 = h 11 h 12 h 13 0 h 21 h 22 h 23 0 h 31 h 32 h 33 0 0 0 0 1

22 P 3 Transformations Transform a point p or plane  with H:Transform a point p or plane  with H: Lines 1: Transform a span:Lines 1: Transform a span: Lines 2: Transform a Plűcker Matrix:Lines 2: Transform a Plűcker Matrix: p’ = H. p  ’ = H -T.  W’ = H. W W*’ = H -T. W* L’ = H. L. H T L*’ = H -T. L*. H -1

23 END


Download ppt "CS 395/495-26: Spring 2003 IBMR: Week 5 A Back to Chapter 2: 3 -D Projective Geometry Jack Tumblin"

Similar presentations


Ads by Google