230 likes | 351 Views
CS 395/495-26: Spring 2003. IBMR: Week 5 A Back to Chapter 2: 3 -D Projective Geometry Jack Tumblin jet@cs.northwestern.edu. IBMR-Related Seminars. 3D Scanning for Cultural Heritage Applications Holly Rushmeier, IBM TJ Watson Friday May 16 3:00pm, Rm 381, CS Dept.
E N D
CS 395/495-26: Spring 2003 IBMR: Week 5 A Back to Chapter 2: 3-D Projective Geometry Jack Tumblin jet@cs.northwestern.edu
IBMR-Related Seminars 3D Scanning for Cultural Heritage Applications Holly Rushmeier, IBM TJ Watson Friday May 16 3:00pm, Rm 381, CS Dept. no title yet ...<BRDF, BRSSDF capture? Optics of Hair? Inverse Rendering?> Steve Marschner, Cornell University Friday May 23 3:00pm, Rm 381, CS Dept.
3D Homogeneous Coordinates Extend Projective space from 2D to 3D: • P2: • From 2D ‘world space’ (x,y) make • 2D homogeneous coordinates (x1,x2,x3). • 2D projective ‘image space’ (x’,y’) = (x1/x3, x2/x3) • P3: • From 3D ‘world space’ (x,y,z) make • 3D homogeneous coordinates (x1,x2,x3,x4). • 3D projective ‘image space’ (x’,y’,z’) = (x1/x4, x2/x4, x3/x4)
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… in R3, write point x as But in P3, write same point x as: where: x1 x2 x3 x4 x y z x = x1 / x4, y = x2 / x4, z = x3 / x4, x4 = anything non-zero!(but usually defaults to 1) y (x,y,z) x z
A Very Common Mistaek: • P2 homog. coords: 2D projective map (2D point3D ray is correct) • P3 homog. coords. 3D projective map ( But 3D point3D ray’ is WRONG!) (x,y) (x1, x2, x3) (x,y,z) (x1, x2, x3, x4) x2 x2 x3 y x x1 x1
A Very Common Mistaek • P2 homog. coords: 2D projective map (2D point3D ray) • P3 homog. coords. 3D projective map ( 3D point3D ray’ is WRONG!) (x,y) (x1, x2, x3) (x,y,z) (x1, x2, x3, x4) x2 NO! Don’t confuse 3D ‘z’ with projective x4! x2 (x,y,z) x3 y x x1 x1
P3: 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 ax + by + cz +d = 0 a b c d x1 x2 x3 x4 = 0 xT.= 0
3D Homogeneous Coordinates • P2 homog. coords: 2D projective map (2D point3D ray) • P3 homog. coords. 3D projective map 3D point4D ‘ray’: --an impossible-to-draw plane in R4 with normal x1,x2,x3 --its 3D part is a ray through origin (x,y) (x1, x2, x3) (x,y,z) (x1, x2, x3, x4) x2 x2 (x,y,z) x3 x3 y x x1 (Approx. as many 2D planes of constant z) x1 (One 2D planeof constant z)
3D Homogeneous Coordinates P3 homog. coords. 3D projective map 3D point4D ‘ray’: --Superset of P2 transformations: --Includes translation, projection from any point H (x,y,z) (x1, x2, x3, x4) (x1’, x2’, x3’, x4’) (x,y,z) x2 x2 x3 x3 x1 x1 (Approx. as many 2D planes of constant z)
Points Plane Conversions • Find plane thru points P1,P2,P3? • Easy! Stack points: • Find null space (SVD) • (Rank 2? collinear points!) • OR: use 3D cross products: = 0 PT1 PT2 PT3 1 2 3 4 p11 p12 p13 p14 p21 p22 p23 p24 p31 p32 p33 p34 = 0 (p1 - p3) (p2 - p3) • • -p3T · (p1 p2) • = (p1 – p3) (p2-p3) – x3•(x1 x2) = (scalar)
Points Planes in P3 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 P3 point p:M p = x’ • Finds a 2D coords in P2plane (of ): x’ = u v w
Lines in P3: Awkward • Geometrically, Lines are: • Intersection of 2 (or more) planes, • An axis or ‘pencil’ of planes, • Linear combo of 2 points, p1+ A(p2-p1) • a 4 DOF entity in P3; a 4-vector won’t do! • Symbolically: Three forms of P3 lines: • ‘Span’ : Null Space of matrix W • Plűcker Matrix • Plűcker Line Coordinates
P3 Lines 1a: (Point-Point) Span W • Recall that a point xis on a plane iff • if 2 given points A, B intersectwith a ‘pencil’ of planes on a line, • Define a ‘P3 line’ as that intersection: stack AT, BTto make 2x4 matrix W: W = • If line W contains the plane , then W = 0 xT.= 0 B A A B T.= 0 a1 a2 a3 a4 b1 b2 b3 b4
P3 Lines 1b: (Plane-Plane) Span W* • Recall that a point xis on a plane if • If 2 given planes P,Q intersect ata ‘pencil’ of points on a line, • Define a ‘P3 line’ as that intersection: stack PT, QTto make 2x4 matrix W*: W* = • If line W* contains the point x,thenW* x = 0 xT.= 0 P Q xT.PQ = 0 p1 p2 p3 p4 q1 q2 q3 q4
P3 Lines 1:Spans • (Point) Span W • (Found from points A,B) • Used to test plane : • (Plane) Span W* • (Found from planes P,Q) • Used to test point x: B W = 0 A Useful property: WT W* = W* WT = 02x2 (the 2x2 null matrix) P Q W* x = 0
P3 Lines 1: ‘Join’ reverses Spans... • Join Line W and Point p Plane W = 0 iff plane holds line W, andpT = 0 iff plane holds point p; stack … Let M = ; solve for in M = 0 • Join Line W* and Plane Point p 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 pT W*
P3 Lines 2: Plűcker Matrices Line == A 4x4 symmetric matrix, rank 2, 4DOF • Line L through known points A, B: L = A.BT - B.AT = • LineL*through known planesP,Q: L* = P.QT – QPT Two forms: B A a1a2a3a4 b1b2b3b4 - b1 b2 b3 b4 a1 a2 a3 a4 P Q
P3 Lines 2: Plűcker Matrices Line == A 4x4 symmetric matrix, rank 2, 4DOF • Line L through A, B pts: L = A.BT - B.AT • LineL*through P,Q planes: L* = P.QT - QPT • L L* convert?Note that: • Skew-symmetric; • L’s has 6 params: or • Note det|L|=0 is written l12l34+ l13l42 +l14l23= 0 • Simple! Replace lijwithlmn so that {i,j,m,n} = {1,2,3,4}Examples: l12 l34,or l42l13 etc. l12l13l14l23l24l34 l12l13l14l23l34l42 (to avoid minus signs)
P3 Lines 2: Plűcker Matrices • Join Line L* and Point p Plane L*.p =(if point is on the line, then L*.p = 0) Join Line L and Plane Point p L. =p (if line is in the plane, then L. =0)
P3 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: l12l13l14l23l24l34 l12l13l14l23l34l42 (to avoid minus signs) l12l13l14l23l42l34 L = l12l34+ l13l42 +l14l23= 0
Projective Transformations • Use H for transforms in P3: • Has 15 DOF (4x4 -1) • Superset of the P2H matrix: Homework Hint: ProjA show P2 objects in R3 x1x,x2y,x3z; uses h11 h12 h13 h14 h21 h22 h23 h24 h31 h32 h33 h34h41 h42 h43 h44 H = h11 h12 0 h13 h21 h22 0 h23 0 0 0 0h31 h32 0 h33 h11 h12 h13 h21 h22 h21 h31 h32 h33 H2 = h11 h12 h130 h21 h22 h230 h31 h32 h330 0 0 01
P3 Transformations • Transform a point p or plane with H: • Lines 1: Transform a span: • Lines 2: Transform a Plűcker Matrix: p’ = H.p’ = H-T. W’ = H.W W*’ = H-T.W* L’ = H.L.HT L*’ = H-T.L*.H-1