C++ Essential Matrix estimation

Various algorithms for estimating the Essential matrix, E, from five or seven points, are implemented. They can be used alone (see documentation in ransac/hypothesiser.h) or as the hypothesis generators in my RANSAC/BaySAC implementation (e.g. by setting parameter RANSAC.HypothesiseAlg=7PtEFast in your config file). The Levenberg-Marquardt-based fivepoint solvers will be described in "Fast RANSAC hypothesis generation for essential matrix estimation", DICTA 2011.

Algorithm Summary Class name Source code RANSAC.HypothesisAlgorithm
7-point with Gram-Schmid to compute basis Very fast (~1 microsecond, compared with 10-20 microsecs for others), numerical errors not significant enough to influence RANSAC hypothesis generation (but degenerate for planar configurations). C7ptEssentialMat_GS essentialMat_Eigen.cpp CRANSACParams::e7PtEFast
5-point with Lev-Mar to compute E from basis vectors Fast, only finds a subset of possible solutions. CEssentialMatLMbasis essentialMatLM2.cpp CRANSACParams::e5Pt_GradientDesc
5-point Polynomial Algorithm by Nister (2004). Finds (almost) all solutions. C5ptEssentialMat essentialMat_Eigen.cpp CRANSACParams::e5PtE
5-point with Lev-Mar to compute E via a translation and quaternion Not as fast as the basis-vectors method, only finds a subset of possible solutions. Either on manifold (eMinimalOnManifold) or with minimal 5D parameterisation (eMinimal). CEssentialMatLM essentialMatLM.cpp -
5-point with Grobner basis and eigendecomposition to compute E. Algorithm by Stewenius (2006). Finds all solutions. Relatively slow. C5ptEssentialMat essentialMat_Eigen.cpp -

 

A MAPLE worksheet for expanding E as a function of a quaternion and a translation vector is available here.

Refinement

RANSAC/BaySAC only find approximately-correct essential matrices, which should be further refined to minimise some error function on the inlier set. Use the functions in refineEOnRTManifold.h to find the least-squares solution, or to minimise the Blake-Zisserman robust cost function of Sampson's error. Paper: "Refining essential matrix estimates from RANSAC". See example of use here...