Class FundamentalToProjective

java.lang.Object
boofcv.alg.geo.f.FundamentalToProjective

public class FundamentalToProjective extends Object
Computes projective camera matrices from a fundamental matrix. All work space is predeclared and won't thrash the garbage collector. See section 9.5 in R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003
  • Constructor Details

    • FundamentalToProjective

      public FundamentalToProjective()
  • Method Details

    • twoView

      public void twoView(DMatrixRMaj F, DMatrixRMaj cameraMatrix)

      Given a fundamental matrix a pair of camera matrices P0 and P1 can be extracted. Same twoView(DMatrixRMaj, DMatrixRMaj) but with the suggested values for all variables filled in for you.

      Parameters:
      F - (Input) Fundamental Matrix
      cameraMatrix - (Output) resulting projective camera matrix P'. (3 by 4) Known up to a projective transform.
    • twoView

      public void twoView(DMatrixRMaj F, Point3D_F64 e2, Vector3D_F64 v, double lambda, DMatrixRMaj cameraMatrix)

      Given a fundamental matrix a pair of camera matrices P and P1' are extracted. The camera matrices are 3 by 4 and used to project a 3D homogenous point onto the image plane. These camera matrices will only be known up to a projective transform, thus there are multiple solutions, The canonical camera matrix is defined as:

       P=[I|0] and P'= [M|-M*t] = [[e']*F + e'*v^t | lambda*e']
       
      where e' is the epipole FTe' = 0, [e'] is the cross product matrix for the enclosed vector, v is an arbitrary 3-vector and lambda is a non-zero scalar.

      NOTE: Additional information is needed to upgrade this projective transform into a metric transform.

      Page 256 in R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003

      Parameters:
      F - (Input) A fundamental matrix
      e2 - (Input) Left epipole of fundamental matrix, FT*e2 = 0.
      v - (Input) Arbitrary 3-vector. Just pick some value, say (0,0,0).
      lambda - (Input) A non zero scalar. Try one.
      cameraMatrix - (Output) resulting projective camera matrix P'. (3 by 4) Known up to a projective transform.
    • threeView

      public boolean threeView(DMatrixRMaj F21, DMatrixRMaj F31, DMatrixRMaj F32, DMatrixRMaj P2, DMatrixRMaj P3)

      Given three fundamental matrices describing the relationship between three views, compute a consistent set of projective camera matrices. Consistent means that the camera matrices will give back the same fundamental matrices. Non-linear refinement might be needed to get an optimal solution.

      The first camera matrix, without loss of generality, P1 = [I|0]. NOTE: HZ does not recommend using this function because the optimal solution is not geometric and prone to errors. Instead it recommends use of trifocal tensor to find a set of camera matrices. When testing the function it was noted that the geometry had to be carefully selected to ensure stability. Hinting that it might not be the most practical algorithm in real data.
      1. Page 301 in Y. Ma, S. Soatto, J. Kosecka, and S. S. Sastry, "An Invitation to 3-D Vision" Springer-Verlad, 2004
      2. Page 386 and 255 in R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003
      Parameters:
      F21 - (Input) Fundamental matrix between view 1 and 2
      F31 - (Input) Fundamental matrix between view 1 and 3
      F32 - (Input) Fundamental matrix between view 2 and 3
      P2 - (Output) Camera matrix for view 2
      P3 - (Output) Camera matrix for view 3
    • getThreeViewError

      public double getThreeViewError()
    • getConvergence

      public ConfigConverge getConvergence()