270 likes | 391 Views
CS 395/495-25: Spring 2003. IBMR: Week 8A Chapter 8... Epipolar Geometry: Two Cameras: Jack Tumblin jet@cs.northwestern.edu. IBMR-Related Seminars. Light Scattering Models For Rendering Human Hair Steve Marschner, Cornell University Friday May 23 3:00pm, Rm 381, CS Dept. Reminders.
E N D
CS 395/495-25: Spring 2003 IBMR: Week 8A Chapter 8... Epipolar Geometry: Two Cameras: Jack Tumblin jet@cs.northwestern.edu
IBMR-Related Seminars Light Scattering ModelsFor Rendering Human Hair Steve Marschner, Cornell University Friday May 23 3:00pm, Rm 381, CS Dept.
Reminders • ProjA graded: Good Job! 90,95, 110 • ProjB graded: Good! minor H confusions. • MidTerm graded: novel solutions encouraged. • ProjC due Friday, May 16: many rec’d... • ProjD posted, due Friday May 30 • (Last Week’s IAC notes revised...) • Take-Home Final Exam: Thurs June 5, due June 11
Camera Matrix P links P3P2 xfspx0 0 yfpy00 0 1 0 y Input:X 3D World Space Output: x 2D Camera Image x X (world space) z yc C zc xc x(camera space) y x • Basic camera: x = P0 X whereP0 = [K | 0] = • World-space camera: translate X to camera location C, then rotate: x = PX = (P0·R·T) X • Rewrite as: P = K[R | -RC] • Redundant notation:P = [M | p4]M = KRp4 = -K R C ~ ~ ~
Chapter 7: More One-Camera Details Full 3x4 camera matrix P maps P3world to P2 image ? What does it do to basic 3D world shapes? Forward Projection: • Line / Ray in world Line/Ray in image: • Ray in P3 is: X() = A + B • Camera changes to P2: x() = PA + PB yc A PA B p C f zc xc
Chapter 7: More One-Camera Details Full 3x4 camera matrix P maps P3world to P2 image ? What does it do to basic 3D world shapes? Backward Projection: • Line L in image Plane L in world: • Recall: Line L in P2 (a 3-vector): L =[x1 x2 x3]T • Plane L in P3 (a 4-vector): L = PT·L = p11 p21 p31 p12 p22 p32p13 p23 p33p14 p24 p34 x1x2x3 yc L zc p C f xc
Cameras as Protractors cos = x1T (K-TK-1) x2(x1T (K-TK-1) x1) (x2T (K-TK-1) x2) d2 n x2 d1 x1 C L • World-Space Direction: D = [xc, yc, zc, 0]T • Direction from image point x: D = (KR)-1x • Point C and points x1,x2 form angle : (pg 199) (K-TK-1)= = ‘Image of Absolute Conic’ Line L makes plane with normal n = KT L (in camera coords)
Cameras as Protractors x1 x2 x3 0 x1 x2 x30 P () = (K-TK-1). OK.Now what was again? • Absolute Conic =all imaginary points on • Satisfies BOTH x12 + x22 + x32 = 0 AND x42 = 0 • Finds right angles-- if D1D2, then: D1T· ·D2= 0 • Dual of absolute conic is Dual QuadricQ* = allimaginaryplanesto, tangent toQ* • Finds right angles-- if 12, then: 1T· Q*·2= 0 • can writeor Q* as the same matrix: 1 0 0 00 1 0 00 0 1 00 0 0 0
Cameras as Protractors Clever vanishing point trick: • Perpendicular lines in image? • Find their vanishing pts. by construction: • Use v1T v2 = 0, stack, solve for = (K-TK-1) v3 v2 v1
Cameras as Protractors 1 0 0 0 0 1 0 00 0 1 00 0 0 0 P = (K-TK-1)= = ‘Image of Absolute Conic’ • Just as has a dual Q*, has dual * : * = -1 = K KT • The dual conic * is the image of Q* , so * = P (Q*)= P( ) • Vanishing points v1,v2of 2 world-space lines:v1T v2 = 0 • Vanishing lines L1, L2of 2 world-space planes:L1T* L2 = 0
Movement Detection? • Can we do it from images only? • 2D projective transforms often LOOK like 3-D; • External cam. calib. affects all elements of P • YES. Camera moved if-&-only-ifCamera-ray points (CxX1,X2, etc…) will map to LINE (not a point) in the other image • ‘Epipolar Line’ == l’ = image of L • ‘Parallax’ == x1’x2’ vector X2 X1 x2’ x1’ L x C’ l’ C
Epipolar Geometry: Chapter 8 Basic idea: • Given ONLY images from 2 cameras C, C’ • Different views of same objects X, butwe don’t know world-space points X. • If we choose an x, how can we find x’ ? • How are x, x’ linked? X x’ x C’ C
Epipolar Geometry: Chapter 8 Basic idea: • 2 cameras located at C, C’ in world space. • Find ‘baseline’ through camera centers C, C’ • Baseline hits image planes at ‘epipoles’ Notice baseline and Xform a plane... Many OTHER planesthru baseline ... X x’ x baseline C’ C
Epipolar Geometry: Chapter 8 Basic idea: • 2 cameras located at C, C’ in world space. • Find ‘baseline’ through camera centers C, C’ • Baseline hits image planes at ‘epipoles’ • Family of planes thru baseline are all the ‘epipolar planes’ • Image of planes = lines =‘epipolar lines’ • Lines intersect at epipolar points in both images. x’ x baseline C’ C
Epipolar Geometry: Chapter 8 Summary: • Connect cameras C, C’ with a baseline, which hits image planes at epipoles e, e’. • Chose any world pt X, then everything is coplanar! epipolar plane includes image points x, x’, and these connect to epipoles e,e’ by epipolar lines L, L’ X epipolar plane epipolar line L’ epipolar line L x’ x baseline C’ e’ e C
Epipolar Geometry Useful properties: • Every image point x maps to an epipolar line L’also: • Epipoles e,e’ = each camera’s view of the other • All epipolar lines L’ pass through epipole e’ • Epipolar Line L’ is (image of the CX ray...) • Epipolar Line L’ links (image of C) to (image of X) X epipolar plane epipolar line L’ epipolar line L x’ x baseline C’ e’ e C
Fundamental Matrix: Fx = L’ One Matrix Summarizes ALL of Epipolar Geometry Fundamental Matrix F: 3x3, rank 2. • Maps image point x to image point x’: x’T F x = 0 but F is only Rank 2 – given only x, F cannot find x’ for you!! • Maps image point x to epipolar line L’: F x = L’ X epipolar plane epipolar line L’ epipolar line L x’ x baseline C’ e’ e C
Fundamental Matrix: Fx = L’ 1) How do we findF? If we know the camera matrices P and P’ (we almost never do), book derives: (pg 224) F = [e’]P’ P+ ?!?!What?!?! point e’ cross product with a matrix p’p+ ?!?! X epipolar plane epipolar line L’ epipolar line L X() x’ x baseline C’ e’ C (Recall: P+ = PT(PPT)-1, the pseudo-inverse)
Fundamental Matrix: Fx = L’ F = [e’]P’ P+But what’s this? NEW TRICK: • Cross Product written as matrix multiply (pg. 554) a b = = = == [a]·b • Note: a b = -b a = [a]·b = (aT·[b])T X epipolar plane epipolar line L’ epipolar line L X() x’ x baseline C’ e’ C b1 b2 b3 a2b3 – a3b2 a3b1 – a1b3 a1b2 – a2b1 0 -a3 a2 a3 0 -a1-a2 a1 0 b1 b2 b3 a1 a2 a3 ‘skew symmetric’ matrix
Fundamental Matrix: Fx = L’ • 2) What is F if we DON’T know the cameras P, P’,but we DO know some corresp. point pairs (x, x’)? • F finds epipolar line L’ from point x : Fx = L’ • (Recall that if (any) point x’ is on line a L’, then x’T L’= 0) • Substitute Fx for L’: x’TF x = 0 AHA! we can find F using DLT-like method! see Chap. 10 X epipolar plane epipolar line L’ epipolar line L X() x’ x baseline C’ e’ C
Fundamental Matrix Summary (pg. 226) F is 3x3 matrix, maps P2P2, rank 2, 7-DOF • If world space pt X image space pts. x and x’ then x’TF x = 0 • Every image pt has epipolar line in the other image:Fx = L’FTx’ = L • Baseline pierces image planes at epipoles e, e’ : Fe = 0 FTe’ = 0
Fundamental Matrix Summary (pg. 226) F is 3x3 matrix, maps P2P2, rank 2, 7-DOF • Given camera matrices P, P’, find F matrix by: F = [e’] P’ P+ (recall: e’ is image of C: e’ = P’C) • F is unaffected by any proj. transforms done on BOTH cameras(PH, P’H) has same F matrix as (P, P’) for any full-rank H (e.g. F measures camera C vs. Camera C’ only, no matter where you put them)
Fundamental Matrix Uses tx ty tz Special case: camera translate only (no rotations) • Camera matrices are P= K[ I | 0 ], P’ = K[I | t ] • where K is internal calib., t is 3D translation vector • F matrix simplifies to F = [e’] • Epipolar lines are all parallel to direction t • x,x’ displacement depends only on t & 3D depth z: x’ = x + (Kt)(1/zc)
Fundamental Matrix Uses Can we find a camera matrix from motion + fundamental F? • Let one camera position define the world’s coords:P = P0 = K[ I | 0 ], and other is P’ = [M | m] = K[R | -RC] where K is internal calib., R is rotation C is position • F matrix simplifies to F = [m]M • If we know how we moved the camera (R,C matrices) then find F by correspondence and solve for K. (pg 237) • No R, C matrices? Use Essential Matrix (pg 238) ~ ~
Fundamental Matrix Properties (pg. 226) Why bother with F? • Can find it from image pt. correspondences only • Works even for mismatched cameras (example: 100-year time-lapse of Eiffel tower) • Choose your own world-space coordinate system. • SVD lets us recover P0, P’ camera matrices from F (See 8.6 ‘The Essential matrix’pg 240) • Complete 2-camera mapping from worldimage • 2 images + corresponding point pairs (xi,x’i)F • Let camera coords == 3D world coords, then (xi,x’i)Xi
Correspondence Problem: Where Computer Vision, IBMR part ways: Fundamental Matrix + Corresponding point pairs (x,x’) How can we ‘blunt’ the correspondence problem?