Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does fundamental matrix have 7 degrees of freedom?

There are 9 parameters in the fundamental matrix to relate the pixel co-ordinates of left and right images but only 7 degrees of freedom (DOF).

The reasoning for this on several pages that I've searched says :

  1. Homogenous equations means we lose a degree of freedom

  2. The determinant of F = 0, therefore we lose another degree of freedom.

I don't understand why those 2 reasons mean we lose 2 DOF - can someone explain it?

like image 665
nababs Avatar asked Apr 10 '18 22:04

nababs


People also ask

Why does the fundamental matrix have 7 degrees of freedom?

Fundamental matrix from seven point correspondences In the case where A has rank 7, it is still possible to solve for fundamental matrix by using the singularity constraint. The reason is that fundamental matrix has only seven degrees of freedom since it is defined up to a scale and det(F)=0 d e t ( F ) = 0 .

How many degrees of freedom does essential matrix have?

The Essential matrix is a 3×3 matrix that contains 5 degrees of freedom. It has rank 2 and is singular. The Essential matrix is useful for computing the epipolar lines associated with p and p .

Why do we need 8 points to estimate the fundamental matrix?

It is because in the case of fundamental matrix, each correspondence point relates to only one constraint(i.e it maps a point to a line in other image). Hence 8 correspondence points are required.

What is degree of freedom in matrix?

Degree of freedom - The remaining variables are so called free variables. The number of free variables is the degree of freedom. Rank - Rank is the number of x variables that can be brought down in the course of pivoting.


2 Answers

We initially have 9 DOF because the fundamental matrix is composed of 9 parameters, which implies that we need 9 corresponding points to compute the fundamental matrix (F). But because of the following two reasons, we only need 7 corresponding points.

Reason 1

We lose 1 DOF because we are using homogeneous coordinates. This basically is a way to represent nD points as a vector form by adding an extra dimension. ie) A 2D point (0,2) can be represented as [0,2,1], in general [x,y,1]. There are useful properties when using homogeneous coordinates with 2D/3D transformation, but I'm going to assume you know that.

Now given the expression p and p' representing pixel coordinates:

p'=[u',v',1] and p=[u,v,1]

the fundamental matrix:

F = [f1,f2,f3]
    [f4,f5,f6]
    [f7,f8,f9]

and fundamental matrix equation:

(transposed p')Fp = 0

when we multiple this expression in algebra form, we get the following:

uu'f1 + vu'f2 + u'f3 + uv'f4 + vv'f5 + v'f6 + uf7 + vf8 + f9 = 0. 

In a homogeneous system of linear equation form Af=0 (basically the factorization of the above formula), we get two components A and f.

A:

[uu',vu',u', uv',vv',v',u,v,1] 

f (f is essentially the fundamental matrix in vector form):

[f1,f2'f3,f4,f5,f6,f7,f8,f9]

Now if we look at the components of vector A, we have 8 unknowns, but one known value 1 because of homogeneous coordinates, and therefore we only need 8 equations now.

Reason 2

det F = 0.

A determinant is a value that can be obtained from a square matrix.

I'm not entirely sure about the mathematical details of this property but I can still infer the basic idea, and, hopefully, you can as well.

Basically given some matrix A

A = [a,b,c]
    [d,e,f]
    [g,h,i]

The determinant can be computed using this formula:

det A = aei+bfg+cdh-ceg-bdi-afh

If we look at the determinant using the fundamental matrix, the algebra would look something like this:

F = [f1,f2,f3]
    [f4,f5,f6]
    [f7,f8,f9]

det F = (f1*f5*f8)+(f2*f6*f7)+(f3*f4*f8)-(f3*f5*f7)-(f2*f4*f9)-(f1*f6*f8)

Now we know the determinant of the fundamental matrix is zero:

det F = (f1*f5*f8)+(f2*f6*f7)+(f3*f4*f8)-(f3*f5*f7)-(f2*f4*f9)-(f1*f6*f8) = 0

So, if we work out only 7 of the 9 parameters of the fundamental matrix, we can work out the last parameter using the above determinant equation.

Therefore the fundamental matrix has 7DOF.

like image 80
Curator Corpus Avatar answered Mar 19 '23 03:03

Curator Corpus


The reasons why F has only 7 degrees of freedom are

  1. F is a 3x3 homogeneous matrix. Homogeneous means there is a scale ambiguity in the matrix, so the scale doesn't matter (as shown in @Curator Corpus 's example). This drops one degree of freedom.
  2. F is a matrix with rank 2. It is not a full rank matrix, so it is singular and its determinant is zero (Proof here). The reason why F is a matrix with rank 2 is that it is mapping a 2D plane (image1) to all the lines (in image 2) that pass through the epipole (of image 2).

Hope it helps.

like image 45
Daniel Li Avatar answered Mar 19 '23 01:03

Daniel Li