CS 395/495-25: Spring 2003 IBMR: Week 6B R 3  R 2 and P 3  P 2 The Camera Matrix Jack Tumblin

Slides:



Advertisements
Similar presentations
Single-view geometry Odilon Redon, Cyclops, 1914.
Advertisements

Epipolar Geometry.
Primitives Behaviour at infinity HZ 2.2 Projective DLT alg Invariants
Computer vision: models, learning and inference
Camera Calibration. Issues: what are intrinsic parameters of the camera? what is the camera matrix? (intrinsic+extrinsic) General strategy: view calibration.
Camera Models CMPUT 498/613 Richard Hartley and Andrew Zisserman, Multiple View Geometry, Cambridge University Publishers, 2000 Readings: HZ Ch 6, 7.
Camera calibration and epipolar geometry
Camera Models A camera is a mapping between the 3D world and a 2D image The principal camera of interest is central projection.
1 Basic geometric concepts to understand Affine, Euclidean geometries (inhomogeneous coordinates) projective geometry (homogeneous coordinates) plane at.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Used slides/content with permission from
Epipolar geometry. (i)Correspondence geometry: Given an image point x in the first view, how does this constrain the position of the corresponding point.
Lecture 7: Image Alignment and Panoramas CS6670: Computer Vision Noah Snavely What’s inside your fridge?
CS485/685 Computer Vision Prof. George Bebis
3D reconstruction of cameras and structure x i = PX i x’ i = P’X i.
CS 395/495-26: Spring 2004 IBMR: Projective 2D DLT Jack Tumblin
Camera model Relation between pixels and rays in space ?
CS 395/495-26: Spring 2003 IBMR: Week 4A from Chapter 3: Point Correspondence and Direct Linear Transform (DLT) Jack Tumblin
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Lecture 13: Projection, Part 2
CS 395/495-25: Spring 2004 IBMR: The Fundamental Matrix The Fundamental Matrix Combines Two Cameras Jack Tumblin
Cameras and Projections Dan Witzner Hansen Course web page:
CS 395/495-25: Spring 2004 IBMR: R 3  R 2 and P 3  P 2 : The Projective Camera Matrix Jack Tumblin
CS 395/495-26: Spring 2003 IBMR: Week 5 A Back to Chapter 2: 3 -D Projective Geometry Jack Tumblin
CS 395/495-25: Spring 2003 IBMR: Week 8A Chapter 8... Epipolar Geometry: Two Cameras: Jack Tumblin
Transformations I CS5600Computer Graphics by Rich Riesenfeld 27 February 2002 Lecture Set 5.
Single-view geometry Odilon Redon, Cyclops, 1914.
The Pinhole Camera Model
CV: 3D sensing and calibration
MSU CSE 803 Fall 2008 Stockman1 CV: 3D sensing and calibration Coordinate system changes; perspective transformation; Stereo and structured light.
CS 395/495-25: Spring 2003 IBMR: Week 7A The Camera Matrix Continued... Jack Tumblin
CS4670 / 5670: Computer Vision KavitaBala Lecture 15: Projection “The School of Athens,” Raphael.
CS 395/495-25: Spring 2003 IBMR: Week 9A Image-Based Physics: Measuring Light & Materials Jack Tumblin
Camera parameters Extrinisic parameters define location and orientation of camera reference frame with respect to world frame Intrinsic parameters define.
1 Digital Images WorldCameraDigitizer Digital Image (i) What determines where the image of a 3D point appears on the 2D image? (ii) What determines how.
Stockman MSU/CSE Math models 3D to 2D Affine transformations in 3D; Projections 3D to 2D; Derivation of camera matrix form.
CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin
CS 450: Computer Graphics 2D TRANSFORMATIONS
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
Projective Geometry and Camera Models
Lecture 14: Projection CS4670 / 5670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Course 12 Calibration. 1.Introduction In theoretic discussions, we have assumed: Camera is located at the origin of coordinate system of scene.
Geometric Models & Camera Calibration
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Geometric Camera Models
Vision Review: Image Formation Course web page: September 10, 2002.
Parameter estimation. 2D homography Given a set of (x i,x i ’), compute H (x i ’=Hx i ) 3D to 2D camera projection Given a set of (X i,x i ), compute.
Computer Vision : CISC 4/689 Going Back a little Cameras.ppt.
Camera diagram Computing K from 1 image HZ8.8 IAC and K HZ8.5 Camera matrix from F HZ9.5 IAC HZ , 8.5 Extracting camera parameters HZ6.2 Camera matrix.
2003CS Hons RW778 Graphics1 Chapter 7: Three-Dimensional Viewing Chapter 5: Camera with parallel projection Chapter 5: Camera with parallel projection.
1 Chapter 2: Geometric Camera Models Objective: Formulate the geometrical relationships between image and scene measurements Scene: a 3-D function, g(x,y,z)
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
ELE 488 Fall 2006 Image Processing and Transmission ( )
Affine Geometry.
Single-view geometry Odilon Redon, Cyclops, 1914.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Camera Models class 8 Multiple View Geometry Comp Marc Pollefeys.
Lecture 14: Projection CS4670 / 5670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Parameter estimation class 5 Multiple View Geometry CPSC 689 Slides modified from Marc Pollefeys’ Comp
Calibrating a single camera
Depth from disparity (x´,y´)=(x+D(x,y), y)
Homogeneous Coordinates (Projective Space)
Epipolar geometry.
Multiple View Geometry Comp Marc Pollefeys
Geometric Camera Models
IBMR: Week 4B Chapter 3: CS 395/495-26: Spring 2003
The Pinhole Camera Model
Presentation transcript:

CS 395/495-25: Spring 2003 IBMR: Week 6B R 3  R 2 and P 3  P 2 The Camera Matrix Jack Tumblin

Reminders ProjA graded: Good Job!ProjA graded: Good Job! ProjB being graded...ProjB being graded... MidTerm Due today, Thurs May 8: Solutions!MidTerm Due today, Thurs May 8: Solutions! Watson’s Late Policy: Grade -(3 n ) points; n=# of class meetings lateWatson’s Late Policy: Grade -(3 n ) points; n=# of class meetings late ProjC posted tonight; Due next Thurs, May 15ProjC posted tonight; Due next Thurs, May 15 ProjD coming Thurs May 15, due Thurs May 29ProjD coming Thurs May 15, due Thurs May 29 Take-Home Final Exam coming June 5, dueTake-Home Final Exam coming June 5, due

Cameras Revisited Goal: Formalize projective 3D  2D mappingGoal: Formalize projective 3D  2D mapping Homogeneous coords handles infinities wellHomogeneous coords handles infinities well –Projective cameras ( convergent ‘eye’ rays) –Affine cameras (parallel ‘eye’ rays) –Composed, controlled as matrix product But First: Cameras as Euclidean R 3  R 2 :But First: Cameras as Euclidean R 3  R 2 : x’ = f x / z y’ = f y / z y y’ f z C

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal PointPrincipal Point Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point!?!?)Principal Plane (?!?! DOESN’T touch principle point!?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) ycycycyc zczczczc xcxcxcxc

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal PointPrincipal Point Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point!?!?)Principal Plane (?!?! DOESN’T touch principle point!?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) f ycycycyc zczczczc xcxcxcxc

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal PointPrincipal Point Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point!?!?)Principal Plane (?!?! DOESN’T touch principle point!?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) f C ycycycyc zczczczc xcxcxcxc

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal Point pPrincipal Point p Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point!?!?)Principal Plane (?!?! DOESN’T touch principle point!?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) f C ycycycyc zczczczc xcxcxcxc p

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal Point pPrincipal Point p Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point!?!?)Principal Plane (?!?! DOESN’T touch principle point!?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) f C ycycycyc zczczczc xcxcxcxc p

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal Point pPrincipal Point p Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point P !?!?)Principal Plane (?!?! DOESN’T touch principle point P !?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) f C ycycycyc zczczczc xcxcxcxc p

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal Point pPrincipal Point p Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point!?!?)Principal Plane (?!?! DOESN’T touch principle point!?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) f C ycycycyc zczczczc xcxcxcxc p

Cameras Revisited Plenty of Terminology: Image Plane or Focal PlaneImage Plane or Focal Plane Focal Distance fFocal Distance f Camera Center CCamera Center C Principal Point pPrincipal Point p Principal AxisPrincipal Axis Principal Plane (?!?! DOESN’T touch principle point!?!?)Principal Plane (?!?! DOESN’T touch principle point!?!?) Camera Coords (x c,y c,z c )Camera Coords (x c,y c,z c ) Image Coords (x’,y’)Image Coords (x’,y’) f C ycycycyc zczczczc xcxcxcxc p

Homogeneous Coords: R 3  P 2 Basic Camera as a 3x4 matrix:Basic Camera as a 3x4 matrix: Tricky! X is in augmented R 3, not P 3 (yet)Tricky! X is in augmented R 3, not P 3 (yet) x is in P 2 space x is in P 2 space As shown: origin of (x’,y’) is principal point p,As shown: origin of (x’,y’) is principal point p, but pixel counting starts at corners… x’y’z’ f f xcxcycyczczc11xcxcycyczczc111 = P 0 X = x P 0 X = x y y’ f z C ycycycyc xcxcxcxc zczczczc p

Homogeneous Coords: R 3  P 2 Basic Camera as a 3x4 matrix:Basic Camera as a 3x4 matrix: Translate image coords (x’,y’): Shifts principal point p from (0,0) to (p x,p y )Translate image coords (x’,y’): Shifts principal point p from (0,0) to (p x,p y ) –is NOT obvious: scales z c –does NOT use ‘homogeneous’ 1 term in X x’y’z’ xcxcycyczczc11xcxcycyczczc111 = P 0 X = x P 0 X = x y y’ f z C ycycycyc xcxcxcxc zczczczc p f 0 p x 0 0 f p y

Homogeneous Coords: R 3  P 2 Basic Camera as a 3x4 matrix:Basic Camera as a 3x4 matrix: Less common adjustments: Non-square pixels? change scaling (  x,  y )Non-square pixels? change scaling (  x,  y ) Parallelogram pixels? set nonzero skew sParallelogram pixels? set nonzero skew s K matrix: “(internal) camera calib. matrix” K matrix: “(internal) camera calib. matrix” xyz xcxcycyczczc11xcxcycyczczc111 = P 0 X = x P 0 X = x y y’ f z C ycycycyc xcxcxcxc zczczczc p  x f s p x 0 0  y f p y K (3x3 submatrix)

Matrix Form: Euclidean R 3  R 2 K matrix: “internal camera calib. matrix”K matrix: “internal camera calib. matrix” R·T matrix: “external camera calib. matrix”R·T matrix: “external camera calib. matrix” –T matrix: Translate world to cam. origin –R matrix: 3D rotate world to fit cam. axes Combine: write (P 0 ·R·T)·X = x as P·X = x Output: x 2D Camera Image Input: X 3D World Space zyx X (world space) zczczczc ycycycyc xcxcxcxc C x (camera space)

END

0 1 Uses for Camera Matrix P P’s Null Space: camera center C in world space! P C = 0 (solve for C. SVD works, but answer matches these:)P’s Null Space: camera center C in world space! P C = 0 (solve for C. SVD works, but answer matches these:) –Finite Camera: C = Affine Camera: C = Surprise! (minor) works projectively too: P 3  P 2Surprise! (minor) works projectively too: P 3  P 2 (see book pg for restrictions—almost none!) xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or ~~ P =P =P =P = M p4p4p4p4 -M -1 ·p 4 d (where Md=0) ~ ~

Uses for Camera Matrix P Columns of P matrix: Points in image-space: P 1,P 2,P 3 == image of x,y,z axis vanishing pointsP 1,P 2,P 3 == image of x,y,z axis vanishing points –Proof: let D = [ ] T = point on x axis, at inifinity –PD = 1 st column of P. Repeat for y and z axes P 4 == image of the world-space origin pt.P 4 == image of the world-space origin pt. –Proof: let D = [ ]T = world origin –PD = 4 th column of P = image of origin pt. xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or P =P =P =P = P1P1P1P1 P2P2P2P2 P3P3P3P3 f C ycycycyc zczczczc xcxcxcxc p P4P4P4P4

Uses for Camera Matrix P Rows of P matrix: planes in world space row 1 = p 1T = image x-axis planerow 1 = p 1T = image x-axis plane row 2 = p 2T = image y-axis planerow 2 = p 2T = image y-axis plane row 1 = p 3T = camera’s principal planerow 1 = p 3T = camera’s principal plane xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or P =P =P =P = p 1T p 2T p 3T f C ycycycyc zczczczc xcxcxcxc p

Uses for Camera Matrix P Rows of P matrix: planes in world space row 1 = p 1 = image x-axis planerow 1 = p 1 = image x-axis plane row 2 = p 2 = image y-axis planerow 2 = p 2 = image y-axis plane row 1 = p 3 = camera’s principal planerow 1 = p 3 = camera’s principal plane xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or P =P =P =P = p 1T p 2T p 3T f C ycycycyc zczczczc xcxcxcxc p

Uses for Camera Matrix P Rows of P matrix: planes in world space row 1 = p 1 = image x-axis planerow 1 = p 1 = image x-axis plane row 2 = p 2 = image y-axis planerow 2 = p 2 = image y-axis plane row 1 = p 3 = camera’s principal planerow 1 = p 3 = camera’s principal plane xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or P =P =P =P = p 1T p 2T p 3T f C ycycycyc zczczczc xcxcxcxc p

Uses for Camera Matrix P Rows of P matrix: planes in world space row 1 = p 1 = image x-axis planerow 1 = p 1 = image x-axis plane row 2 = p 2 = image y-axis planerow 2 = p 2 = image y-axis plane Careful! Shifting image originCareful! Shifting image origin shifts the x,y axis planes! xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or P =P =P =P = p 1T p 2T p 3T f C ycycycyc zczczczc xcxcxcxc p

Uses for Camera Matrix P Rows of P matrix: planes in world space row 1 = p 1 = image x-axis planerow 1 = p 1 = image x-axis plane row 2 = p 2 = image y-axis planerow 2 = p 2 = image y-axis plane row 3 = p 3 = camera’s principal planerow 3 = p 3 = camera’s principal plane xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or P =P =P =P = p 1T p 2T p 3T f C ycycycyc zczczczc xcxcxcxc p

Uses for Camera Matrix P Rows of P matrix: planes in world space row 1 = p 1 = image x-axis planerow 1 = p 1 = image x-axis plane row 2 = p 2 = image y-axis planerow 2 = p 2 = image y-axis plane row 3 = p 3 = camera’s principal planerow 3 = p 3 = camera’s principal plane – princip. plane p 3 = [p 31 p 32 p 33 p 34 ] T – its normal direction: [p 31 p 32 p 33 0 ] T –Why is it normal? It’s the world-space endpoint of z c axis (at infinity ) xcxcycyczczcxcxcycyczczc xwxwywywzwzwtwtwxwxwywywzwzwtwtw = P P·X = x, or P =P =P =P = p 1T p 2T p 3T f C ycycycyc zczczczc xcxcxcxc p Principal plane p 3

Chapter 6 In Just One Slide: Given point correspondence sets (x i  X i ), How do you find camera matrix P ? (full 11 DOF) Given point correspondence sets (x i  X i ), How do you find camera matrix P ? (full 11 DOF) Surprise! You already know how ! DLT method: -rewrite H x = x’ as Hx  x’ = 0 -rewrite P X = x as PX  x = 0DLT method: -rewrite H x = x’ as Hx  x’ = 0 -rewrite P X = x as PX  x = 0 -vectorize, stack, solve Ah = 0 for h vector -vectorize, stack, solve Ap = 0 for p vector -Normalizing step removes origin dependence More data  better results (at least 28 point pairs)More data  better results (at least 28 point pairs) Algebraic & Geometric Error, Sampson Error…Algebraic & Geometric Error, Sampson Error…