Geometric Models & Camera Calibration

Slides:



Advertisements
Similar presentations
C280, Computer Vision Prof. Trevor Darrell Lecture 2: Image Formation.
Advertisements

Single-view geometry Odilon Redon, Cyclops, 1914.
Computer Vision, Robert Pless
CS 691 Computational Photography Instructor: Gianfranco Doretto 3D to 2D Projections.
Computer vision: models, learning and inference
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.
Structure from motion.
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Geometry of Images Pinhole camera, projection A taste of projective geometry Two view geometry:  Homography  Epipolar geometry, the essential matrix.
Announcements. Projection Today’s Readings Nalwa 2.1.
Used slides/content with permission from
Lecture 5: Projection CS6670: Computer Vision Noah Snavely.
Structure from motion. Multiple-view geometry questions Scene geometry (structure): Given 2D point matches in two or more images, where are the corresponding.
Uncalibrated Geometry & Stratification Sastry and Yang
CS485/685 Computer Vision Prof. George Bebis
COMP322/S2000/L221 Relationship between part, camera, and robot (cont’d) the inverse perspective transformation which is dependent on the focal length.
Computer Vision - A Modern Approach
Camera model Relation between pixels and rays in space ?
Computer Vision : CISC4/689
Multiple View Geometry Marc Pollefeys University of North Carolina at Chapel Hill Modified by Philippos Mordohai.
Calibration Dorit Moshe.
Cameras and Projections Dan Witzner Hansen Course web page:
Lecture 12: Projection CS4670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Lecture 6: Image Warping and Projection CS6670: Computer Vision Noah Snavely.
© 2003 by Davi GeigerComputer Vision October 2003 L1.1 Structure-from-EgoMotion (based on notes from David Jacobs, CS-Maryland) Determining the 3-D structure.
Previously Two view geometry: epipolar geometry Stereo vision: 3D reconstruction epipolar lines Baseline O O’ epipolar plane.
Single-view geometry Odilon Redon, Cyclops, 1914.
The Pinhole Camera Model
Projected image of a cube. Classical Calibration.
CS223b, Jana Kosecka Rigid Body Motion and Image Formation.
Camera parameters Extrinisic parameters define location and orientation of camera reference frame with respect to world frame Intrinsic parameters define.
Stockman MSU/CSE Math models 3D to 2D Affine transformations in 3D; Projections 3D to 2D; Derivation of camera matrix form.
Cameras, lenses, and calibration
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
Camera Geometry and Calibration Thanks to Martial Hebert.
Epipolar geometry The fundamental matrix and the tensor
Image Formation Fundamentals Basic Concepts (Continued…)
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 Camera Models
Vision Review: Image Formation Course web page: September 10, 2002.
Peripheral drift illusion. Multiple views Hartley and Zisserman Lowe stereo vision structure from motion optical flow.
Lecture 03 15/11/2011 Shai Avidan הבהרה : החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
Affine Structure from Motion
Single-view geometry Odilon Redon, Cyclops, 1914.
CS-498 Computer Vision Week 7, Day 2 Camera Parameters Intrinsic Calibration  Linear  Radial Distortion (Extrinsic Calibration?) 1.
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.
A Flexible New Technique for Camera Calibration Zhengyou Zhang Sung Huh CSPS 643 Individual Presentation 1 February 25,
EECS 274 Computer Vision Affine Structure from Motion.
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)
Reconnaissance d’objets et vision artificielle Jean Ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire.
Computer vision: models, learning and inference M Ahad Multiple Cameras
Camera Model Calibration
Single-view geometry Odilon Redon, Cyclops, 1914.
Instructor: Mircea Nicolescu Lecture 9
Camera Models class 8 Multiple View Geometry Comp Marc Pollefeys.
Camera Calibration Course web page: vision.cis.udel.edu/cv March 24, 2003  Lecture 17.
Calibrating a single camera
Computer vision: models, learning and inference
Depth from disparity (x´,y´)=(x+D(x,y), y)
Homogeneous Coordinates (Projective Space)
Lecture 13: Cameras and geometry
Geometric Camera Models
Uncalibrated Geometry & Stratification
Announcements Midterm out today Project 1 demos.
Reconstruction.
Single-view geometry Odilon Redon, Cyclops, 1914.
The Pinhole Camera Model
Presentation transcript:

Geometric Models & Camera Calibration Reading: Chap. 2 & 3

Introduction We have seen that a camera captures both geometric and photometric information of a 3D scene. Geometric: shape, e.g. lines, angles, curves Photometric: color, intensity What is the geometric and photometric relationship between a 3D scene and its 2D image? We will understand these in terms of models.

Models Models are approximations of reality. “Reality” is often too complex, or computationally intractable, to handle. Examples: Newton’s Laws of Motion vs. Einstein’s Theory of Relativity Light: waves or particles? No model is perfect. Need to understand its strengths & limitations.

Camera Projection Models 3D scenes project to 2D images Most common model: pinhole camera model From this we may derive several types of projections: orthographic weak-perspective para-perspective perspective least accurate most accurate

Pinhole Camera Model real image plane virtual image plane object Z Y f optical centre object Z Y f f image is inverted image is not inverted

Real vs. Virtual Image Plane The image is physically formed on the real image plane (retina). The image is vertically and laterally inverted. We can imagine a virtual image plane at a distance of f in front of the camera optical center, where f is the focal length. The image on this virtual image plane is not inverted. This is actually more convenient. Henceforth, when we say “image plane” we will mean the virtual image plane.

Perspective Projection f u

Perspective Projection The imaging process is a many-to-one mapping all points on the 3D ray map to a single image point. Therefore, depth information is lost From similar triangles, can write down the perspective equation:

Perspective Projection This assumes coordinate axes is at the pinhole.

t : World origin w.r.t. camera 3D Scene point P Camera coordinate system Rotation R t : World origin w.r.t. camera coordinate axes World coordinate system P : 3D position of scene point w.r.t world coordinate axes R : Rotation matrix to align world coordinate axes to camera axes

Perspective Projection α, β : scaling in image u, v axes, respectively Θ : skew angle, that is, angle between u, v axes u0, v0 : origin offset Note: α=kf, β=lf where k, l are the magnification factors

Intrinsic vs. Extrinsic parameters Intrinsic: internal camera parameters. 6 of them (5 if you don’t care about focal length) Focal length, horiz. & vert. magnification, horiz. & vert. offset, skew angle Extrinsic: external parameters 6 of them 3 rotation angles, 3 translation param Imposing assumptions will reduce # params. Estimating params is called camera calibration.

Representing Rotations Euler angles pitch: rotation about x axis : yaw: rotation about y axis: roll: rotation about z axis: X Y Z

Rotation Matrix Two properties of rotation matrix: R is orthogonal: RTR = I det(R) = 1

Orthographic Projection Projection rays are parallel Camera centre optical axis Image plane Parallel lines

Orthographic Projection Equations : first two rows of R : first two elements of t This projection has 5 degrees of freedom.

Weak-perspective Projection Image plane Parallel lines

Weak-perspective Projection This projection has 7 degrees of freedom.

Para-perspective Projection Parallel lines Image plane

Para-perspective Projection Camera matrix given in textbook Table 2.1, page 36. Note: Written a bit differently. This has 9 d.o.f.

Real cameras Real cameras use lenses Lens distortion causes distortion in image Lines may project into curves See Chap 1.2, 3.3 for details Change of focal length (zooming) scales the image not true if assuming orthographic projection) Color distortions too

Color Aberration Bad White Balance Unlike human vision, cameras can not adapt their spectral responses to cope with different lighting conditions; as a result, the acquired image may have an undesirable shift in the entire color range. Digital cameras have an function called white balancing. If improperly white balanced, the color and tone of the whole picture will be wrong. Over-exposure at the time.

Color Aberration Purple Fringing When camera lens is wide open and there's high contrast in the scene, what normally should be a white line could appear purple. That is called "purple fringing" or a "halo" effect. The purple fringe around the edges is mainly caused by color interpolation combined with chromatic aberration. There are little patches of light purple discoloration all around the background and a heavy purple fringing artifact appeared along the leaning branch.

Color Aberration Vignetting we can notice that the corners of the print are getting darker. Darkening of an image around the edges and corners is called “vignetting”. It’s mainly caused by two reasons: One is the design of the camera or lens itself. All lenses falloff toward the corners, and the physical lens barrier would prevent some light from entering the lens. Therefore, the central part of an image would be brighter than that of the parts at the corner or along the edges. The other cause may be light hitting the film or CCD sensor surface at an oblique angle. It’s more often occurring when using wide-angle lenses. In flash photography a similar effect can be caused by the coverage of the flash being insufficient to illuminate the field of view.

Geometric Camera Calibration

Recap A general projective matrix: This has 11 d.o.f. , i.e. 11 parameters 5 intrinsic, 6 extrinsic How to estimate all of these? Geometric camera calibration

Key Idea Capture image of a known 3D object (calibration object). Establish correspondences between 3D points and their 2D image projections. Estimate M Estimate K, R, and t from M Estimation can be done using linear or non-linear methods. We will study linear methods first.

Setting things up Calibration object: 3D object, or 2D planar object captured at different locations

Setting it up Suppose we have N point correspondences: P1, P2, … PN are 3D scene points u1, u2, … uN are corresponding image points Let mT1, mT2, mT3 be the 3 rows of M Let (ui, vi) be the (non-homogeneous) coords of the i th image point. Let Pi be the homogeneous coords of i th scene point.

Math For the i th point Each point gives 2 equations. Using all N points gives 2N equations:

Math A m = 0 A : 2N x 12 matrix, rank is 11 m : 12 x 1 column vector Note that m has only 11 d.o.f.

Math Solution? m is in the Nullspace of A ! Use SVD: A = U ∑ VT m = last column of V m is only up to an unknown scale In this case, SVD solution makes || m || = 1

Estimating K, R, t Now that we have M (3x4 matrix) c is the 3D coords of camera center wrt World axes Let ĉ be homogeneous coords of c It can be shown that M ĉ = 0 So ĉ is in the Nullspace of M And t is computed from –Rc, once R is known.

Estimating K, R, t B, the left 3x3 submatrix of M is KR Perform “RQ” decomposition on B. The “Q” is the required rotation matrix R And the upper triangular “R” is our K matrix ! Impose the condition that diagonals of K are positive We are done!

RQ factorization Any n x n matrix A can be factored into A = RQ Where both R, Q are n x n R is upper triangular, Q is orthogonal Not the same as QR factorization Trick: post multiply A by Givens rotation matrices: Qx ,Qy, Qz

RQ factorization c, s chosen to make a particular entry of A zero For example, to make a21 = 0, we solve Choose Qx ,Qy, Qz such that

Degeneracy Caution: The 3D scene points should not all lie on a plane. Otherwise no solution In practice, choose N >= 6 points in “general position” Note: the above assumes no lens distortion. See Chap 3.3 for how to deal with lens distortion.

Summary Presented pinhole camera model From this we get hierarchy of projection types Perspective, Para-perspective, Weak-perspective, Orthographic Showed how to calibrate camera to estimate intrinsic + extrinsic parameters.