/2/ Projective Geometry and Camera Models Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem
Note about HW Out before next Tues Prob: covered today, Tues Prob2: covered next Thurs Prob3: covered following week
Last class: intro Overview of vision, examples of state of art Logistics
Next two classes: Single view Geometry How tall is this woman? How high is the camera? What is the camera rotation? What is the focal length of the camera? Which ball is closer?
Today s class Mapping between image and world coordinates Pinhole camera model Projective geometry homogeneous coordinates and vanishing lines Camera matrix Other camera parameters
Image formation Slide source: Seitz Let s design a camera Idea : put a piece of film in front of an object Do we get a reasonable image?
Pinhole camera Idea 2: add a barrier to block off most of the rays This reduces blurring The opening known as the aperture Slide source: Seitz
Pinhole camera f c f = focal length c = center of the camera Figure from Forsyth
Camera obscura: the pre camera First idea: Mo Ti, China (47BC to 39BC) First built: Alhacen, Iraq/Egypt (965 to 39AD) Illustration of Camera Obscura Freestanding camera obscura at UNC Chapel Hill Photo by Seth Ilys
First Photograph First photograph Took 8 hours on pewter plate Photograph of the first photograph Joseph Niepce, 826 Stored at UT Austin
Dimensionality Reduction Machine (3D to 2D) 3D world 2D image Point of observation Figures Stephen E. Palmer, 22
Projection can be tricky Slide source: Seitz
Projection can be tricky Slide source: Seitz
Projective Geometry What is lost? Length Who is taller? Which is closer?
Length is not preserved A C B Figure by David Forsyth
Projective Geometry What is lost? Length Angles Parallel? Perpendicular?
Projective Geometry What is preserved? Straight lines are still straight
Vanishing points and lines Parallel lines in the world intersect in the image at a vanishing point
Vanishing points and lines Vanishing Line Vanishing Point o Vanishing Point o
Slide from Efros, Photo from Criminisi Vanishing points and lines Vertical vanishing point (at infinity) Vanishing line Vanishing point Vanishing point
Vanishing points and lines Photo from online Tate collection
Note on estimating vanishing points Use multiple lines for better accuracy but lines will not intersect at exactly the same point in practice One solution: take mean of intersecting pairs bad idea! Instead, minimize angular differences
(more vanishing points on board)
Vanishing objects
Projection: world coordinates image coordinates (work on board)
Homogeneous coordinates Conversion Converting to homogeneous coordinates homogeneous image coordinates homogeneous scene coordinates Converting from homogeneous coordinates
Homogeneous coordinates Invariant to scaling x k y w = kx ky kw Homogeneous Coordinates kx kw ky kw = x w y w Euclidean Coordinates Point in Euclidean is ray in Homogeneous
Basic geometry in homogeneous coordinates Line equation: ax + by + c = Append to pixel coordinate to get homogeneous coordinate Line given by cross product of two points Intersection of two lines given by cross product of the lines ij line p i ij i = = ui vi i line = p i a b c p q = line line i i i j j
Another problem solved by homogeneous coordinates Intersection of parallel lines Euclidean: (Inf, Inf) Homogeneous: (,, ) Euclidean: (Inf, Inf) Homogeneous: (, 2, )
Projection matrix Slide Credit: Saverese R,T j w k w O w i w x = K[ R t]x x: Image Coordinates: (u,v,) K: Intrinsic Matrix (3x3) R: Rotation (3x3) t: Translation (3x) X: World Coordinates: (X,Y,Z,)
Interlude: when have I used this stuff?
When have I used this stuff? Object Recognition (CVPR 26)
When have I used this stuff? Single view reconstruction (SIGGRAPH 25)
When have I used this stuff? Getting spatial layout in indoor scenes (ICCV 29)
When have I used this stuff? Inserting photographed objects into images (SIGGRAPH 27) Original Created
When have I used this stuff? Inserting synthetic objects into images (submitted)
[ ]X x = K I = z y x f f v u k K Slide Credit: Saverese Projection matrix Intrinsic Assumptions Unit aspect ratio Optical center at (,) No skew Extrinsic Assumptions No rotation Camera at (,,)
Remove assumption: known optical center [ ]X x = K I = z y x v f u f v u k Intrinsic Assumptions Unit aspect ratio No skew Extrinsic Assumptions No rotation Camera at (,,)
Remove assumption: square pixels [ ]X x = K I = z y x v u v u k β α Intrinsic Assumptions No skew Extrinsic Assumptions No rotation Camera at (,,)
Remove assumption: non skewed pixels [ ]X x = K I = z y x v u s v u k β α Intrinsic Assumptions Extrinsic Assumptions No rotation Camera at (,,) Note: different books use different notation for parameters
Oriented and Translated Camera R j w t k w O w i w
Allow camera translation [ ]X t x = K I = z y x t t t v u v u z y x β α Intrinsic Assumptions Extrinsic Assumptions No rotation
3D Rotation of Points Rotation around the coordinate axes, counter-clockwise: = = = cos sin sin cos ) ( cos sin sin cos ) ( cos sin sin cos ) ( γ γ γ γ γ β β β β β α α α α α z y x R R R p p γ y z Slide Credit: Saverese
Allow camera rotation [ ] X t x = K R = 33 32 3 23 22 2 3 2 z y x t r r r t r r r t r r r v u s v u z y x β α
Degrees of freedom [ ] X t x = K R = 33 32 3 23 22 2 3 2 z y x t r r r t r r r t r r r v u s v u k z y x β α 5 6
Scaled Orthographic Projection Special case of perspective projection Distance from the COP to the PP is infinite Also called parallel projection What s the projection matrix? Image World Slide by Steve Seitz = z y x w v u
Other things to be aware of
Radial Distortion Corrected Barrel Distortion Image from Martin Habbecke
Focal length, aperture, depth of field F optical center (Center Of Projection) focal point A lens focuses parallel rays onto a single focal point focal point at a distance f beyond the plane of the lens Aperture of diameter D restricts the range of rays Slide source: Seitz
Depth of field Slide source: Seitz f / 5.6 f / 32 Changing the aperture size or focal length affects depth of field Flower images from Wikipedia http://en.wikipedia.org/wiki/depth_of_field
Large apeture = small DOF Small apeture = large DOF Varying the aperture Slide from Efros
Shrinking the aperture Why not make the aperture as small as possible? Less light gets through Diffraction effects Slide by Steve Seitz
Shrinking the aperture Slide by Steve Seitz
Relation between field of view and focal length Field of view (angle width) fov = tan d 2 f Film/Sensor Width Focal length Dolly zoom (or Vertigo effect ) http://www.youtube.com/watch?v=y48r6 iiyhs
Things to remember Vanishing points and vanishing lines Vanishing line Vanishing point Vertical vanishing point (at infinity) Vanishing point Pinhole camera model and camera projection matrix Homogeneous coordinates x = K[ R t] X
Next class Applications of camera model and projective geometry Recovering the camera intrinsic and extrinsic parameters from an image Recovering size in the world Projecting from one plane to another (if time allows)
Questions