Class FundamentalToProjective
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
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.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.void
twoView
(DMatrixRMaj F, DMatrixRMaj cameraMatrix) Given a fundamental matrix a pair of camera matrices P0 and P1 can be extracted.
-
Constructor Details
-
FundamentalToProjective
public FundamentalToProjective()
-
-
Method Details
-
twoView
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 MatrixcameraMatrix
- (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 matrixe2
- (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.- Page 301 in Y. Ma, S. Soatto, J. Kosecka, and S. S. Sastry, "An Invitation to 3-D Vision" Springer-Verlad, 2004
- 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 2F31
- (Input) Fundamental matrix between view 1 and 3F32
- (Input) Fundamental matrix between view 2 and 3P2
- (Output) Camera matrix for view 2P3
- (Output) Camera matrix for view 3
-
getThreeViewError
public double getThreeViewError() -
getConvergence
-