Prop Projective transformation preserves cross ratio of collinear points:
Proposition
PropTransformation of 2D Points and Lines
Suppose we have transformation from points into points , i.e. , then for any line , it maps to . Proof.
Definition
DefHomography (Matrix)
Homography is a projective transformation between two images of the same planar surface. It is represented by a transformation matrix under a homogenous coordinates.
Homography Estimation
Algorithm
AlgorithmDirect Linear Transformation
Given an equation of the form in the presence of noise. The DLT solution is obtained by computing the SVD of and taking the last column of as the solution for .
Algorithm
AlgorithmDirect Linear Transformation for Homography Estimation
Goal: Given 2D-2D point correspondences , determine the homography matrix such that .
For each correspondence compute matrix , taking only the first rows.
Assemble the matrices into a single matrix .
Compute the SVD of .
Take the last column of as the solution for .
Rearrange to obtain .
where for and
Algorithm
AlgorithmNormalised DLT for Homography Estimation
Goal: Given 2D-2D point correspondences , determine the homography matrix such that .
e.g. Example normalisation matrices: where , and , are image widths and heights respectively.
Algorithm
AlgorithmGold Standard
Goal: Given 2D-2D point correspondences , determine the homography matrix such that .
Initialisation: Compute an initial estimate using normalised DLT or RANSAC.
Geometric minimisation of reprojection error:
Minimise using Levenberg-Marquardt over the entries of .
Compute initial estimate for optimal .
Minimise cost
Denormalise the recovered solution.
Epipolar Geometry
Comment
Epipolar geometry is the intrinsic geometry of 2 different views of the same 3D scene.
Definition
DefBaseline and Epipole
Baseline is the line joining the camera centers. Epipole is the point of intersection of baseline with image plane. Epipolar plane is the plane containing baseline and world point. Epipolar line is the intersection of epipolar plane with the image plane.
e.g. In the following diagram, we have world point , camera centers and , then is the baseline, and is the epipolar line, is the epipolar plane.
Proposition
Prop All epipolar lines intersect at the epipole.
Proposition
Prop Epipole is the projection of one optical centre in the other image.
Essential and Fundamental Matrices
Definition
DefEssential Matrix
The essential matrix encapsulates the epipolar geometry constraints between two views of a 3D scene, with calibrated cameras and contains the intrinsic camera parameters. It is where is the rotation matrix in and is the translation crossproduct matrix in of rank :
Prop The essential matrix has following properties:
It has a rank of .
It is singular, has singular values and .
.
AlgorithmRecovering and from
Implement SVD: .
Output and where
To get all 4 solutions, solve for combinations of and .
Select solution where all of the 3D points are in front of both cameras.
Definition
DefFundamental Matrix
The fundamental matrix encodes the relationship between two images of a 3D scene by encapsulating the epipolar geometry constraints, while the intrinsics of both cameras are not known. Mathematically, such matrix is the unique rank matrix that satisfies for all corresponding points and .
Prop The fundamental matrix has following properties:
If is fundamental matrix for ,then is the fundamental matrix for .
maps from a point in one image to a line in the other image.
Lie on all epipolar lines, thus for all implies .
Algorithm
AlgorithmDLT for Fundamental Matrix Estimation
It is also called the 8-point algorithm. Given 2D-2D point correspondences , determine the fundamental matrix such that .
Let , and
Construct the matrix . And construct the vector .
Minimise subject to , get as the least right singular vector of .
Reshape to get .
But since , replace with by computing the SVD of and setting the smallest singular value to . That is to solve the following optimization problem: Concretely, decompose and set where
Return .
Comment
The 8-Point Algorithm has advantage of being simple and fast, but it is sensitive to noise, and it optimises a non-physical algebraic quantity.
AlgorithmNormalised DLT for Fundamental Matrix Estimation
Transform the points using normalisation matrices and : and .
DefTriangulation Problem
The triangulation problem is to compute the 3D location , given image points and in correspondence across two or more images (taken from calibrated cameras with known intrinsics and extrinsics).
AlgorithmDLT Triangulation
Given camera projection matrix , and corresponding points , :
Precondition points and projection matrices.
Create matrix .
Compute SVD of .
Extract from the last column of .
Then refine with respect to a geometric error.
sample code can be found here.
Stereo Vision
Comment
Humans do 3D perception well from a single image and very well from stereo (binocular) images. An intermediate goal of computer vision was to mimic the functionality of the biological system.
Definition
DefDisparity
Disparity is the positional difference between the two retinal projections of a given point in space.
e.g. In the following setting, we have disparity .
Proposition
Prop If optical axes are parallel and heights of the camera centers are identical, then for points at a fixed depth, the disparity between the corresponding points in the two images is constant.
DefRectified Stereo Images
We say the stereo images are rectified if
Image planes of cameras are parallel;
Principal axes are at same height;
Identical focal lengths.
Prop The epipolar lines fall along the horizontal scan lines of the images in a rectified stereo setting.
The Correspondence Problem
DefCorrespondence Problem
The correspondence problem in stereo vision is the problem of measuring the disparity of each point in the two eye (camera) projections.
LawColour Constancy Constraint
Same world point has same intensity (or colour) in both images.
DefSum of Squared (Pixel) Differences
Suppose and are corresponding by windows of pixels. Define the following window function: The sum of squared difference cost measures the intensity differences as a function of disparity:
Interpretation Problem
DefInterpretation Problem
The interpretation problem in stereo vision is about how to use disparity information to recover the orientation and distance of surfaces in the scene.