Algorithm Search⌘K

Definitioncore

Fundamental matrix

Also called F matrix.

The rank 2 matrix F of two uncalibrated views, defined up to scale, with x2^T F x1 = 0 for every pair of matching pixels x1 in image 1 and x2 in image 2. It has 7 degrees of freedom.

The fundamental matrix FF is the 3×33 \times 3 matrix that writes the epipolar geometry of two views in pixel coordinates: matching points satisfy x2TFx1=0\mathbf{x}_2^{\mathsf T}F\mathbf{x}_1 = 0, with the point of the second image on the left. It needs no knowledge of the intrinsic matrices, which is why it is the matrix of two uncalibrated views. When the intrinsics are known, FF and the essential matrix carry the same information, through F=K2−TEK1−1F = K_2^{-\mathsf T}EK_1^{-1}. This page defines FF and lists its properties; the methods that find it from matches are the eight-point algorithm, its normalized form and the seven-point algorithm.

Definition

Let two cameras have the matrices P1=K1[I∣0]P_1 = K_1[I \mid \mathbf{0}] and P2=K2[R∣t]P_2 = K_2[R \mid \mathbf{t}], so that a point with coordinates X1\mathbf{X}_1 in the frame of camera 1 has X2=RX1+t\mathbf{X}_2 = R\mathbf{X}_1 + \mathbf{t} in the frame of camera 2. Here K1K_1 and K2K_2 are invertible, RR is a rotation, and t≠0\mathbf{t} \ne \mathbf{0}, so the two centers differ. The fundamental matrix of the ordered pair (camera 1, camera 2) is

F=K2−T[t]×R K1−1,F = K_2^{-\mathsf T}[\mathbf{t}]_\times R\,K_1^{-1},

taken up to a nonzero scale, where [t]×[\mathbf{t}]_\times is the skew matrix of t\mathbf{t}.

The correspondence condition. If x1∼P1X\mathbf{x}_1 \sim P_1\mathbf{X} and x2∼P2X\mathbf{x}_2 \sim P_2\mathbf{X} are the images of one point X\mathbf{X}, written as homogeneous pixel vectors, then

x2TFx1=0.\mathbf{x}_2^{\mathsf T}F\mathbf{x}_1 = 0 .

The proof: K1−1x1∼X1K_1^{-1}\mathbf{x}_1 \sim \mathbf{X}_1 and K2−1x2∼X2K_2^{-1}\mathbf{x}_2 \sim \mathbf{X}_2, and X2T[t]×RX1=X2T(t×(X2−t))=X2T(t×X2)=0\mathbf{X}_2^{\mathsf T}[\mathbf{t}]_\times R\mathbf{X}_1 = \mathbf{X}_2^{\mathsf T}(\mathbf{t} \times (\mathbf{X}_2 - \mathbf{t})) = \mathbf{X}_2^{\mathsf T}(\mathbf{t} \times \mathbf{X}_2) = 0. Hartley and Zisserman write the same condition as x′TFx=0\mathbf{x}'^{\mathsf T}F\mathbf{x} = 0, with x′\mathbf{x}' in the second image. Some libraries store the transpose; their matrix is FTF^{\mathsf T} in this convention.

General cameras. For any two camera matrices with different centers, F=[e2]×P2P1+F = [\mathbf{e}_2]_\times P_2P_1^{+}, where P1+P_1^{+} is the pseudo-inverse of P1P_1 and e2=P2C1\mathbf{e}_2 = P_2\mathbf{C}_1 is the image of the first center (Hartley and Zisserman, Section 9.2). For the two cameras above this gives the formula of the definition, up to scale.

Properties. Let FF be a fundamental matrix.

  • Rank 2. det⁡F=0\det F = 0 and F≠0F \ne 0. The null vector e1\mathbf{e}_1 (Fe1=0F\mathbf{e}_1 = \mathbf{0}) is the epipole of image 1, the image of the second center, and the left null vector e2\mathbf{e}_2 (FTe2=0F^{\mathsf T}\mathbf{e}_2 = \mathbf{0}) is the epipole of image 2.
  • Seven degrees of freedom. FF has 9 entries, minus 1 for the scale and 1 for the condition det⁡F=0\det F = 0.
  • Epipolar lines. The epipolar line of x1\mathbf{x}_1 in image 2 is l2=Fx1\mathbf{l}_2 = F\mathbf{x}_1, and that of x2\mathbf{x}_2 in image 1 is l1=FTx2\mathbf{l}_1 = F^{\mathsf T}\mathbf{x}_2.
  • Order. The matrix of the pair in the reverse order (camera 2, camera 1) is FTF^{\mathsf T}.
  • Every rank 2 matrix is one. For every real 3×33 \times 3 matrix FF of rank 2 there are cameras with this fundamental matrix, for example P1=[I∣0]P_1 = [I \mid \mathbf{0}] and P2=[[e2]×F∣e2]P_2 = [[\mathbf{e}_2]_\times F \mid \mathbf{e}_2] (Hartley and Zisserman, Section 9.5). So the conditions "rank 2" and "fundamental matrix" are the same for real matrices.
  • Projective ambiguity. FF does not change when both cameras are multiplied on the right by the same invertible 4×44 \times 4 matrix. So from FF alone the cameras, and the scene, are fixed only up to a projective transformation of space; this is the projective reconstruction theorem.
  • Change of image coordinates. If the images are moved by homographies, x1↦H1x1\mathbf{x}_1 \mapsto H_1\mathbf{x}_1 and x2↦H2x2\mathbf{x}_2 \mapsto H_2\mathbf{x}_2, then FF becomes H2−TFH1−1H_2^{-\mathsf T}FH_1^{-1}. The normalized eight-point algorithm uses this with similarities.

Examples and non-examples

The running example of this group. Take R=(0.800.6010−0.600.8)R = \begin{pmatrix} 0.8 & 0 & 0.6 \\ 0 & 1 & 0 \\ -0.6 & 0 & 0.8 \end{pmatrix}, t=(1,0,0)\mathbf{t} = (1, 0, 0), and K1=K2=K=(50003200500240001)K_1 = K_2 = K = \begin{pmatrix} 500 & 0 & 320 \\ 0 & 500 & 240 \\ 0 & 0 & 1 \end{pmatrix}. The essential matrix is E=[t]×R=(0000.60−0.8010)E = [\mathbf{t}]_\times R = \begin{pmatrix} 0 & 0 & 0 \\ 0.6 & 0 & -0.8 \\ 0 & 1 & 0 \end{pmatrix}, and K−1K^{-1} has rows (1/500,0,−0.64)(1/500, 0, -0.64), (0,1/500,−0.48)(0, 1/500, -0.48) and (0,0,1)(0, 0, 1). Then K−TEK−1K^{-\mathsf T}EK^{-1}, multiplied by 5002500^2, is

F∼(0000.60−592−14450022080).F \sim \begin{pmatrix} 0 & 0 & 0 \\ 0.6 & 0 & -592 \\ -144 & 500 & 22080 \end{pmatrix} .
  • The point X1=(0,0,5)\mathbf{X}_1 = (0, 0, 5) has X2=(4,0,4)\mathbf{X}_2 = (4, 0, 4), so x1=(320,240)\mathbf{x}_1 = (320, 240) and x2=(820,240)\mathbf{x}_2 = (820, 240). The line l2=F(320,240,1)T=(0,−400,96000)\mathbf{l}_2 = F(320, 240, 1)^{\mathsf T} = (0, -400, 96000) is v=240v = 240, and x2\mathbf{x}_2 is on it.
  • The point X1=(0,2.5,5)\mathbf{X}_1 = (0, 2.5, 5) has x1=(320,490)\mathbf{x}_1 = (320, 490) and x2=(820,552.5)\mathbf{x}_2 = (820, 552.5). Then l2=(0,−400,221000)\mathbf{l}_2 = (0, -400, 221000) is v=552.5v = 552.5, and l1=FT(820,552.5,1)T=(187.5,500,−305000)\mathbf{l}_1 = F^{\mathsf T}(820, 552.5, 1)^{\mathsf T} = (187.5, 500, -305000) passes through (320,490)(320, 490), since 60000+245000−305000=060000 + 245000 - 305000 = 0.
  • The epipoles: e1=K(0.8,0,0.6)T∼(2960/3,240,1)≈(986.67,240)\mathbf{e}_1 = K(0.8, 0, 0.6)^{\mathsf T} \sim (2960/3, 240, 1) \approx (986.67, 240), and Fe1=0F\mathbf{e}_1 = \mathbf{0}. The first row of FF is zero, so FT(1,0,0)T=0F^{\mathsf T}(1, 0, 0)^{\mathsf T} = \mathbf{0} and e2=(1,0,0)\mathbf{e}_2 = (1, 0, 0), a point at infinity: the epipolar lines of image 2 are the rows.
  • det⁡F=0\det F = 0, and ∥F∥F≈22094.06\|F\|_F \approx 22094.06. The canonical form with norm 1 and a positive largest entry has F33≈0.99936F_{33} \approx 0.99936. Its entries differ in size by a factor of about 4⋅1044 \cdot 10^4, which is one reason why estimating FF on raw pixels is badly conditioned.

Rectified cameras. With R=IR = I, K1=K2K_1 = K_2 and the second center at (b,0,0)(b, 0, 0), F∼(00000−1010)F \sim \begin{pmatrix} 0 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & 0 \end{pmatrix}, and x2TFx1=v1−v2\mathbf{x}_2^{\mathsf T}F\mathbf{x}_1 = v_1 - v_2. The derivation is on the epipolar geometry page.

Pure translation. With R=IR = I and K1=K2=KK_1 = K_2 = K, the identity K−T[t]×K−1=(det⁡K)−1[Kt]×K^{-\mathsf T}[\mathbf{t}]_\times K^{-1} = (\det K)^{-1}[K\mathbf{t}]_\times gives F∼[e]×F \sim [\mathbf{e}]_\times with e=Kt\mathbf{e} = K\mathbf{t}, a skew-symmetric matrix. For the KK above and a forward step t=(0,0,1)\mathbf{t} = (0, 0, 1), e=(320,240,1)\mathbf{e} = (320, 240, 1), the principal point, and F∼(0−124010−320−2403200)F \sim \begin{pmatrix} 0 & -1 & 240 \\ 1 & 0 & -320 \\ -240 & 320 & 0 \end{pmatrix}. Both epipoles are e\mathbf{e}, and the epipolar lines are the lines through it.

Non-examples.

  • The identity matrix has rank 3, so it is not a fundamental matrix: its "epipolar lines" l2=x1\mathbf{l}_2 = \mathbf{x}_1 do not pass through one common point.
  • The matrix F0F_0 that a linear solve returns from noisy matches usually has rank 3. It becomes a fundamental matrix only after the rank step of the eight-point algorithm.
  • Two images from one center (a camera that only rotates) have no fundamental matrix: t=0\mathbf{t} = \mathbf{0} gives F=0F = 0. The images are related by a homography instead.
  • A homography HH between the two images is not a fundamental matrix, since it has rank 3. But for every plane, F=[e2]×HπF = [\mathbf{e}_2]_\times H_\pi with the homography HπH_\pi that the plane induces.
  • Essential matrix: the fundamental matrix of normalized coordinates, E=K2TFK1E = K_2^{\mathsf T}FK_1. It has 5 degrees of freedom and two equal singular values.
  • Epipolar geometry: the epipoles, epipolar lines and planes that FF encodes.
  • Homography: the other 3×33 \times 3 map between two views, for a plane or for a camera that only rotates. A homography is compatible with FF when HTFH^{\mathsf T}F is skew-symmetric.
  • Camera projection matrix: FF is computed from two of them, and gives two of them back up to a projective transformation.
  • Sampson distance: the first-order distance of a match from the constraint x2TFx1=0\mathbf{x}_2^{\mathsf T}F\mathbf{x}_1 = 0.
  • Trifocal tensor: the three-view analog; it contains the three fundamental matrices of its view pairs.
  • The affine fundamental matrix of two affine cameras has a zero upper-left 2×22 \times 2 block and 4 degrees of freedom.

References

  1. Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Section 9.2, The fundamental matrix F (the geometric and algebraic derivations, the correspondence condition and the summary of properties in Table 9.1); Section 9.5, Retrieving the camera matrices
  2. Richard I. Hartley, In defense of the eight-point algorithm, IEEE Transactions on Pattern Analysis and Machine Intelligence 19(6), 1997, 580-593, the linear estimation of F from point matches and the rank 2 condition
  3. Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Section 11.3, Two-frame structure from motion

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/AZMVF2/text.yaml