Making minimal solvers fast

Martin Bujnak, Zuzana Kukelova, Tomás PajdlaCVPR 2012

Abstract

In this paper we propose methods for speeding up minimal solvers based on Gröbner bases and action matrix eigenvalue computations. Almost all existing Gröbner basis solvers spend most time in the eigenvalue computation. We present two methods which speed up this phase of Gröbner basis solvers: (1) a method based on a modified FGLM algorithm for transforming Gröbner bases which results in a single-variable polynomial followed by direct calculation of its roots using Sturm-sequences and, for larger problems, (2) fast calculation of the characteristic polynomial of an action matrix, again solved using Sturm-sequences. We enhanced the FGLM method by replacing time consuming polynomial division performed in standard FGLM algorithm with efficient matrix-vector multiplication and we show how this method is related to the characteristic polynomial method. Our approaches allow computing roots only in some feasible interval and in desired precision. Proposed methods can significantly speedup many existing solvers. We demonstrate them on three important minimal computer vision problems.

Introduction

In computer vision, "minimal problems" involve estimating geometric parameters—such as camera pose or focal length—from the smallest possible set of data points. These problems are typically solved using Gröbner bases, which transform complex systems of polynomial equations into an "action matrix." The standard approach to finding solutions involves computing the eigenvalues of this action matrix. However, this step is a major computational bottleneck. Standard eigenvalue solvers are designed for general matrices and compute all possible solutions, including complex numbers or physically impossible values. In real-time RANSAC loops, where a solver might be called thousands of times per second, this inefficiency is costly.

Proposed Methods

The authors propose moving away from general eigenvalue solvers in favor of finding the characteristic polynomial of the action matrix and solving for its roots directly. They present two primary techniques:

  1. Modified Matrix FGLM: A variation of the FGLM algorithm that uses matrix-vector multiplication instead of time-consuming polynomial division to generate a single-variable polynomial.
  2. Danilevsky Algorithm: A more numerically stable method that transforms the action matrix into a "companion matrix" (Frobenius form) using a series of similarity transformations. This method is computationally efficient, with a complexity proportional to a single Gauss-Jordan elimination.

Once the characteristic polynomial is obtained, the authors use Sturm-sequences to find real roots within a specific, "feasible" interval. This allows the solver to ignore irrelevant solutions (e.g., complex roots or negative depths) and focus only on the values that make physical sense for the camera geometry.

Experimental Evaluation

The researchers evaluated their methods using synthetically generated data, allowing for precise control over noise and ground truth. They generated 3D points randomly distributed in a cube and projected them onto cameras with random orientations, positions, and focal lengths. Each algorithm was executed 10,000 times to ensure statistically significant results for both speed and numerical stability.

Key Results

The proposed methods significantly outperformed standard Gröbner basis solvers across three classic problems.

6-point Focal Length

The authors achieved a dramatic 8x speedup for the 6-point focal length problem, dropping the computation time from 176.3µs to approximately 21-22µs.

Table 6: Execution times for the 6-point focal length problem.

5-point Relative Pose

For the 5-point relative pose problem, the proposed methods reached ~14µs, a massive improvement over the standard Gröbner approach (61.2µs), though still slightly behind Nister’s specialized closed-form solution (10.6µs).

Table 4: Execution times for the 5-point relative pose problem.

P4P+f (Absolute Pose with Focal Length)

Computation time for the P4P+f problem was cut from 127.4µs to 46.2µs. In terms of stability, the Danilevsky method proved to be the most robust, successfully handling larger systems where other methods (like the Faddeev-Leverrier algorithm) failed due to numerical precision issues.

Conclusion

The strength of this work lies in its generality; it can be applied to almost any minimal problem generated by an automatic solver. While the Matrix FGLM approach can suffer from numerical instability in certain configurations, the Danilevsky algorithm provides a robust alternative. Future work could involve further optimizing the root-finding step or exploring how these solvers behave under high-noise real-world conditions beyond synthetic benchmarks.

Summary updated

BibTeX
@inproceedings{bujnak2012making,
  author = {Martin Bujnak and Zuzana Kukelova and Tomás Pajdla},
  title = {{Making minimal solvers fast}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2012},
  url = {https://openreview.net/forum?id=B1-1oC-_-H},
}
Figure