Unit 3 - Notes

INT345 9 min read

Unit 3: Stereo Geometry, Camera motion and 3D Reconstruction

1. Epipolar Geometry

Epipolar geometry is the intrinsic projective geometry between two views. It is independent of scene structure and depends only on the cameras' internal parameters and relative pose (rotation and translation). It fundamentally constrains the search space for corresponding points between two images from 2D to 1D.

Key Concepts and Terminology

  • Baseline: The line segment connecting the optical centers of the two cameras ( and ).
  • Epipole (): The point of intersection of the baseline with the image plane. Equivalently, the epipole is the image of the optical center of one camera in the other camera's image plane.
  • Epipolar Plane: The plane formed by a 3D point and the two optical centers and .
  • Epipolar Line: The intersection of the epipolar plane with the image plane. All epipolar lines in an image intersect at the epipole.
  • Epipolar Constraint: If a point in the first image corresponds to a 3D point , the corresponding point in the second image must lie on the epipolar line corresponding to .

2. Fundamental Matrix ()

The Fundamental Matrix is a matrix of rank 2 that algebraically represents epipolar geometry. It maps a point in one image to its corresponding epipolar line in the other image.

Mathematical Definition

For any pair of corresponding points (in image 1) and (in image 2) expressed in homogeneous coordinates, the fundamental matrix satisfies the equation:

Properties of the Fundamental Matrix

  1. Size and Rank: It is a matrix with rank 2. The determinant is zero ().
  2. Degrees of Freedom: It has 7 degrees of freedom (9 elements - 1 for scale - 1 for ).
  3. Mapping to Lines: is the epipolar line in the second image corresponding to point in the first image. Similarly, is the epipolar line in the first image.
  4. Epipoles: The epipoles are the null spaces of . and .

3. Normalized 8-Point Algorithm

The 8-point algorithm is a linear method to compute the Fundamental Matrix using 8 or more corresponding point pairs. The normalized version is crucial because raw pixel coordinates lead to ill-conditioned matrices, causing high numerical instability.

Steps of the Normalized 8-Point Algorithm

  1. Normalization:
    • Translate the points in both images so that their centroid is at the origin .
    • Scale the points so that the average distance from the origin is .
    • Apply these transformations via matrices and such that and .
  2. Build the Matrix :
    • Using the constraint , construct a linear system , where is the vector containing the entries of .
    • Each point correspondence contributes one row to : .
  3. Solve for (Linear Solution):
    • Find the vector that minimizes subject to .
    • The solution is the right singular vector of corresponding to the smallest singular value (computed via Singular Value Decomposition - SVD).
  4. Enforce Rank-2 Constraint:
    • The computed will likely have rank 3 due to noise.
    • Perform SVD on .
    • Set the smallest singular value in to 0 to get .
    • Reconstruct the rank-2 matrix: .
  5. Denormalization:
    • Transform the fundamental matrix back to the original image coordinate space: .

4. Algebraic Minimization Algorithm & Geometric Distance Computation

While the 8-point algorithm provides a linear solution based on algebraic error, it does not represent physical, geometric reality optimally. Iterative minimization algorithms are used to refine by minimizing geometric error.

Algebraic vs. Geometric Error

  • Algebraic Error: Minimizes . It has no physical meaning and is just a mathematical convenience for linear solvers.
  • Geometric Distance (Error): Measures the distance between a point and its estimated epipolar line, or the distance between observed points and perfectly consistent projected points.

Geometric Distance Computation

  1. Sampson Error: A first-order approximation to the geometric error. It is computationally cheaper than full reprojection error and highly effective.

    where represents the -th component of the vector.
  2. Reprojection Error (Gold Standard): Finds the perfectly consistent corresponding points that exactly satisfy while being as close as possible to the measured points .

Algebraic Minimization Algorithms

To minimize these nonlinear, non-convex geometric cost functions, iterative optimization algorithms are used:

  • Levenberg-Marquardt (LM) Algorithm: The standard non-linear least-squares optimization technique. It interpolates between the Gauss-Newton algorithm and the method of gradient descent.
  • Process: Start with an initial guess of (usually from the normalized 8-point algorithm), parameterize (often taking care of the rank-2 constraint), and iteratively update the parameters to minimize the Sampson or Reprojection error.

5. Camera Motion and Motion Models

Camera motion describes how a camera moves through a 3D scene, which directly induces apparent motion (optical flow) of objects in the 2D image plane.

Parametric Motion Models

To analyze motion between two frames, we map coordinates in frame 1 to in frame 2 using motion models of varying complexity:

  1. Translational Model (2 DOF): Assumes pure 2D translation in the image plane.
  2. Euclidean / Rigid Model (3 DOF): Translation plus 2D rotation.
  3. Similarity Model (4 DOF): Rigid motion plus uniform scaling.
  4. Affine Model (6 DOF): Accounts for translation, rotation, scaling, and skew. Preserves parallelism.
  5. Projective / Homography Model (8 DOF): Maps any plane to any plane under perspective projection. Preserves straight lines but not parallelism. Highly relevant when a camera rotates purely or observes a planar scene.
    • ,

6. Optical Flow

Optical flow is the pattern of apparent motion of image objects between two consecutive frames caused by the movement of the object or the camera. It is a 2D vector field indicating where every pixel moved.

Brightness Constancy Constraint Equation (BCCE)

The fundamental assumption of optical flow is that the pixel intensity of an object does not change between consecutive frames.

Applying a first-order Taylor expansion yields the optical flow equation:

Where:

  • are the spatial image gradients.
  • is the temporal image gradient.
  • are the horizontal and vertical optical flow vectors (velocities).

The Aperture Problem

The BCCE provides one equation with two unknowns (), meaning the flow cannot be computed locally without further constraints. This is known as the aperture problem.

Algorithms to Compute Optical Flow

  1. Lucas-Kanade Method (Local Method):
    • Assumes that optical flow is constant in a small local neighborhood (e.g., a or window) around the pixel.
    • Sets up an overdetermined system of equations for the neighborhood and solves it using least squares.
    • Works best for small motions and requires distinct features (corners) to avoid singularity.
  2. Horn-Schunck Method (Global Method):
    • Introduces a global smoothness constraint. It assumes optical flow is smooth over the entire image.
    • Minimizes a global energy functional containing a data term (BCCE) and a smoothness term (penalizing large gradients in the flow field).

7. 3D Reconstruction & Linear Triangulation Method

Once the camera matrices ( and ) and the image correspondences ( and ) are known, 3D reconstruction involves finding the 3D position of the point . This process is called Triangulation.

Direct Linear Transformation (DLT) Triangulation

In ideal conditions, the rays back-projected from and would intersect exactly at . Due to noise, they rarely intersect. The Linear Triangulation method finds the best approximation of algebraically.

  1. Formulation:
    • Let and . In homogeneous coordinates, these denote equality up to a scale factor.
    • This collinearity can be expressed using the cross product: and .
  2. Constructing the Equations:
    Let be the -th row of camera matrix . Expanding gives three equations, two of which are linearly independent:


    Doing the same for the second image ( and ), we get a system of 4 linear equations for the unknown 3D point (which is a homogeneous vector).
  3. Matrix Form ():
  4. Solving via SVD:
    • The system is solved by finding the unit vector that minimizes .
    • As with the 8-point algorithm, we apply SVD to ().
    • The solution for is the last column of (the right singular vector corresponding to the smallest singular value).
    • Convert back from homogeneous to Euclidean coordinates by dividing by its 4th component.