Plan
- Review Perspective Projection: Understand the mathematical model of how cameras form images.
- Geometric Camera Calibration: Determine the camera’s parameters.
- Indirect Calibration: First solve for the overall projection matrix, then extract individual parameters.
- Direct Calibration: Solve for parameters more directly (often involving non-linear methods or specific assumptions).
- Multi-planes Method (Zhang’s Method): A popular technique using a planar calibration target.
- Example: Using the Matlab Camera Calibration Toolbox.
- Catadioptric Sensing: (Briefly mentioned, covered in a different slide deck - e.g., using mirrors).
- Other Methods (Not Covered in Detail):
- Vanishing points-based method.
- Self-calibration (using only image correspondences without a known target).
Review: Perspective Projection Model
Camera Parameters
A camera’s imaging process is modeled by several parameters:
- Extrinsic Parameters: Define the camera’s position and orientation in the 3D world.
- Rotation (): A 3x3 rotation matrix describing the camera’s orientation relative to the world coordinate system.
- Translation (): A 3x1 vector describing the position of the camera’s optical center relative to the world origin.
- Intrinsic Parameters: Define the camera’s internal optical and geometric properties. Encoded in the Camera Matrix ().
- Focal Length (): Distance from the optical center to the image plane. Often expressed in pixel units (, ).
- Principal Point ( or ): The point where the optical axis intersects the image plane, usually near the image center. Coordinates are in pixels.
- Pixel Size (): Physical size of a pixel (e.g., mm/pixel). Incorporated into .
- Skew Angle (): Angle between the image sensor’s x and y axes. Usually close to 90 degrees, making the skew factor () close to zero for modern cameras.
Important Term: Intrinsics vs. Extrinsics: Intrinsics describe the camera itself; Extrinsics describe its pose in the world.
(Note: Parameter definitions, especially intrinsics, can vary slightly between texts/toolboxes.)
Projection Equation
The relationship between a 3D world point and its corresponding 2D image point is described by the perspective projection equation. Using homogeneous coordinates:
- 3D world point:
- 2D image point:
The projection is given by:
Where:
- is a scale factor (depth).
- is the intrinsic matrix.
- is the extrinsic matrix (combining rotation and translation ).
- The combined matrix is called the Projection Matrix.
The Intrinsic Matrix (K)
A common form for the intrinsic matrix is:
Where:
- (focal length in x-pixel units)
- (focal length in y-pixel units)
- (skew parameter, often 0)
- is the principal point.
has 5 degrees of freedom (DoF): . If skew is zero and pixels are square (), only 3 DoF remain.
Normalized Image Plane
Conceptually, the projection can be seen as first projecting the 3D point onto a “normalized” image plane located at . The coordinates on this plane are . The intrinsic matrix then maps these normalized coordinates to pixel coordinates, accounting for focal length, principal point, pixel size, and skew.
Properties of Perspective Projection
- Distant objects appear smaller.
- Points project to points.
- Lines project to lines.
- Vanishing Points: Projections of points at infinity. Parallel lines in 3D appear to converge at a vanishing point in the image.
- Angles are not preserved.
- Parallel lines in 3D are not generally parallel in the image (they meet at a vanishing point).
Geometric Camera Calibration
Goal: To estimate the intrinsic () and extrinsic () parameters of a camera. Equivalently, estimate the projection matrix and decompose it.
The Calibration Problem
- Input: A set of known 3D points (e.g., corners on a calibration rig/checkerboard) and their corresponding measured 2D image projections .
- Output: The intrinsic matrix and the extrinsic matrix .
How many points are needed?
- The projection matrix has 12 entries but is defined only up to an overall scale factor, meaning it has 11 degrees of freedom (DoF).
- Each 3D-to-2D point correspondence provides 2 linear constraints on the entries of .
- Therefore, we need at least points. Since we need a whole number of points, we need at least 6 points (providing 12 constraints) to solve linearly for .
- Exam Tip: Remember that has 11 DoF and requires at least 6 point correspondences for a unique solution (assuming points are in general position).
Indirect Calibration (DLT Approach)
This approach first solves for the projection matrix and then decomposes it into , , and .
-
Formulate Linear Equations: Start with the projection equation . Let and , where are the rows of . Writing out the components: Eliminate to get two linear equations in the elements of for each point :
-
Set up Homogeneous Linear System: Stack the equations from points into a single matrix equation:
Where:
- is a matrix constructed from the known and measured .
Structure of P for one point i (two rows) = [, , , ] = [ , , ] = [ , , ] P stacks row1, row2 for all i
- is a vector containing the elements of (e.g., stacked rows or columns).
-
Solve using SVD: This is a homogeneous linear system (). The solution that minimizes subject to is found using Singular Value Decomposition (SVD). Compute the SVD of : . The solution is the last column of , which corresponds to the smallest singular value of . Important Term: DLT (Direct Linear Transformation): This method of solving for transformations (like ) by setting up and solving using SVD is known as DLT.
-
Extract Parameters from M: Once is found, reshape it into the matrix . We know , where is an unknown scale factor.
- Decompose . This can be done using RQ decomposition (similar to QR). Since is upper triangular and is orthogonal, RQ decomposition finds these factors.
- The scale factor can be determined (e.g., by requiring ).
- The translation is then .
- Intrinsic Parameters: Extracted from .
- Extrinsic Parameters: and .
- Faugeras’ Theorem (1993): Provides conditions on (specifically on its left part ) for it to be a valid perspective projection matrix (e.g., ) and for specific constraints like zero-skew.
-
Degenerate Cases: The basic DLT method requires the 3D points to be non-coplanar. If they are coplanar, the solution for is not unique. Special methods (like Zhang’s) handle planar targets.
Handling Lens Distortion
Real lenses introduce distortions not modeled by the ideal pinhole model.
- Types:
- Radial Distortion: Most significant, causes straight lines to appear curved, especially near image edges. (Barrel distortion: magnification decreases with distance from center; Pincushion distortion: magnification increases).
- Spherical Aberration, Chromatic Aberration (less commonly modeled in basic calibration).
- Modeling: Radial distortion is often modeled by adjusting the image coordinates based on their distance from the principal point. Let be the distorted (measured) coordinates and be the undistorted (ideal pinhole) coordinates. Where is the radius using distorted coordinates, and are the radial distortion coefficients. Tangential distortion parameters () can also be added.
- Impact: Including distortion parameters makes the calibration problem non-linear.
- Solution Strategy:
- Initial Guess: Estimate (and thus ) using the linear DLT method, ignoring distortion.
- Non-linear Refinement: Minimize the reprojection error over all parameters (intrinsics , extrinsics for each view, and distortion coefficients ) using an iterative optimization algorithm like Levenberg-Marquardt. Important Term: Reprojection Error: The geometric distance (e.g., Euclidean distance in pixels) between the measured 2D image point and the projected 2D point obtained by projecting the corresponding 3D point using the current estimate of the camera parameters (, distortion).
Direct Calibration (Alternative Approach, e.g., Tsai)
These methods attempt to solve for parameters more directly, sometimes making simplifying assumptions (like zero distortion, known aspect ratio, known principal point) to derive linear solutions for some parameters, followed by non-linear optimization for others. The slides outline one such method (Slides 52-59) involving solving for parts of the extrinsic parameters linearly using SVD, determining scale factors, orthogonalizing the rotation matrix, and finally solving for focal length and . These often require careful handling of scale and signs.
Multi-Plane Calibration (Zhang’s Method)
A very popular and practical method that uses a planar calibration target (e.g., a checkerboard) shown at several different orientations.
- Homography: For a planar target (assume ), the relationship between 3D world points and image points simplifies. Let . The projection is given by a homography : Where is a matrix, and are the first two columns of the rotation matrix .
- Estimate Homographies: For each image () of the planar target, estimate the homography relating the known 2D points on the target plane to the measured 2D image points using DLT.
- Constraints on Intrinsics: Let . We have . Using the properties that are orthonormal columns of :
- (same length) Substitute and . This yields two linear constraints on the matrix (which is symmetric) per homography:
- Solve for Intrinsics (K): Since is symmetric (), it has 6 unique elements. Each homography gives 2 constraints. Stacking constraints from views allows solving linearly for the vector of elements in . Once is known, can be recovered using Cholesky decomposition (since ).
- Solve for Extrinsics ([R|T]): Once is known, the extrinsics for each view can be easily computed from the corresponding homography .
- Refinement: Perform non-linear minimization of reprojection error (as described before) to refine , all , and potentially lens distortion parameters. Exam Tip: Zhang’s method is important. Key ideas: planar target → homography, constraints from rotation matrix properties on intrinsics, linear solve for , non-linear refinement.
Self-Calibration
- Goal: Calibrate the camera using only point correspondences between multiple images, without a known calibration object.
- Assumptions: Typically assumes a static scene and fixed intrinsic parameters across views.
- Method: Relies on constraints from projective geometry, often involving the “image of the absolute conic.”
- Characteristics: Highly flexible (no special setup needed) but generally less accurate and robust than methods using calibration targets. More complex mathematically.