Automatic Generator of Minimal Problem Solvers
Summary (4 min read)
1 Introduction
- Many problems can be formulated using systems of algebraic equations.
- Often, polynomial systems which arise are not trivial.
- On the other hand, all known computer vision problems share the property that the elimination path associated with their solution is the same for all interesting configurations of coefficients of a given problem.
- The input into their automatic generator is the system of polynomial equations which the authors want to solve with a particular choice of coefficients from Zp that choose the particular elimination path.
- In the next two sections the authors review the Gröbner basis method for solving systems of polynomial equations and the solvers based on this method.
2 Solving systems of polynomial equations
- In the next the authors mostly consider this matrix representation of systems of equations and, for example, by Gauss-Jordan (G-J) elimination of equations they understand G-J elimination of the corresponding coefficient matrix M. Solving systems of algebraic polynomial equations is a very challenging problem.
- There doesn’t exist one robust, numerically stable and efficient method for solving such systems in general case.
- Therefore, special algorithms have to be designed for specific problems.
- The general Gröbner basis method for solving systems of polynomial equations can be quite inefficient in some cases but it was recently used successfully as the basis for efficient solvers of computer vision minimal problems.
- The authors now describe this method and the solvers based on this method.
3 Gröbner basis method
- Computing such basis and “reading off” the solutions from it is one standard method for solving systems of polynomial equations.
- Although this sounds really nice and easy the reality is much harder.
- Unfortunately, computation of such Gröbner basis w.r.t. the lexicographic ordering is very time consuming and for most of the problems can not be used.
- Now the authors can use nice properties of a special action matrix defined in this space, to find solutions to their system of equations (1).
4 Gröbner basis solver
- The Gröbner basis method for solving systems of polynomial equations based on action matrices was recently used to solve many minimal problems in computer vision.
- This fact was in some way implicitly used in previous solvers [18, 19, 9] but hasn’t been fully articulated.
- The method starts with the matrix M, which has the property that after its G-J elimination all polynomials qi necessary for constructing the action matrix are obtained.
- All the previous steps, i.e. finding the number of solutions, basis G, basis B, the generation of elimination template(s) and the reduction of unnecessary polynomials, are performed only once in the automatic generator.
5 The automatic procedure for generatig Gröbner basis solvers
- In this section the authors describe their approach to automatic generation of such Gröbner basis solvers to general problems.
- The input of this automatic generator is the system of polynomial equations with coefficients from Zp and the output is the solver, the MATLAB or C code, which returns solutions to this system of polynomial equations for concrete coefficients from R. The authors automatic generator consists of several independent modules .
- Since all these parts are independent, they can be further improved or replaced by more efficient implementations.
- Next the authors briefly describe each of these parts.
5.1 Polynomial equations parser
- First, input equations are split into coefficient and monomials.
- For the automatic generator, the authors instantiate each known parameter occurring in coefficients with a random number from the Zp.
- This is important for the code generation module to be able to track the elimination path.
5.2 Computation of the basis B and the number of solutions
- This module starts with the system of polynomial equations F , which the authors want to solve, with random coefficients from Zp.
- For many problems, the interesting “regular” solutions can be obtained with almost any random choice of coefficients.
- The coefficients from Zp speed up computations, minimize memory requirements and especially avoid numerical instability.
- To obtain this information the authors use the existing algorithms implemented in algebraic geometry softwares Macaulay 2 or Maple.
- Modularity of the generator allows replacing this part of the code by another existing module computing the Gröbner basis G and the basis B [6].
5.3 Single elimination template construction
- The input to this third, most important, step of their automatic generator is the basis B of the quotient ring A and the polynomial f for which the authors want to create the action matrix.
- The authors use an individual variable i.e. f = xk, called “action variable”, to create the action matrix.
- As explained in Section 4, there are several ways how to generate these polynomials from the initial polynomial equations F .
- The authors stop when all necessary polynomials qi are obtained.
- The generator tries to add polynomials starting with the polynomials with as low degree as possible.
5.4 Reducing the size of the template
- This part of the automatic generator starts with the polynomials generated in the previous step.
- The authors know that after the G-J elimination of these polynomials (i.e. of the corresponding matrix M) they obtain all polynomials that they need for constructing of the action matrix.
- The algorithm in Section 4 removes polynomials one by one and each time calls expensive G-J elimination.
- These two steps considerably speed up the reduction process.
- Moreover, the authors can employ the fact that polynomials in the elimination template are ordered by the degree of their leading monomials.
5.5 Construction the action matrix
- To create the template for the action matrix Mxk , the authors identify those rows of eliminated matrix M (matrix M after the G-J elimination) which correspond to polynomials qi.
- The action matrix will than contain coefficients from these rows which correspond to the monomials from the basis B and will have the form (5).
- For the generated online solver the authors just need to know which rows and columns they need to extract.
- Note that the structure of the eliminated matrix is always the same for all instances of the problem.
5.6 Generating efficient online solver
- The generated online solver consist of the following steps: 1. construction of the coefficient matrix (from elimination template); 2. G-J elimination; 3. action matrix extraction; 4. solution extraction from eigenvectors of the action matrix.
- To build the coefficient matrix the authors use unique identifiers associated with coefficients of each of the input polynomials.
- Recall that in the construction of the elimination template the authors use the input equations and multiply them by monomials.
- Reducing of the polynomials and further optimizations results only in removing rows or columns in the index matrix.
- Then, after G-J elimination, it reads values form precomupted rows and columns and builds the action matrix.
6 Experiments
- In this section the authors demonstrate that their automatic generator constructs efficient and numerically stable solvers which are comparable or outperform known manually constructed solvers.
- Since the automatic procedure described in this paper generates very similar Gröbner basis solvers as those proposed in the original solutions, there is no point in testing the behavior of generated solvers under noise, outliers or on real images.
- For all considered problems the authors have obtained comparable or quite smaller elimination templates than those used in the original solvers.
- The authors choose two problems, the well known [18] and more complex “radial distortion problem” [4], to evaluate and compare the intrinsic numerical stability of the existing solvers with their solvers generated automatically.
- These generated scenes consist of 1000 points distributed randomly within a cube.
6.1 Six Point Focal Length Problem
- The problem of estimating the relative camera position for two cameras with unknown focal length is a classical and popular problem in computer vision.
- After this four new polynomials are added and eliminated.
- More recently, another Gröbner basis solver to this problem was proposed in [2].
- For the action variable w their generator first generates all monomial multiples of initial ten polynomial equations up to total degree eight.
- Since the authors did not have the source code of the solver proposed in [2], they have compared their generated solver with the original solver proposed by Stewénius [18].
6.2 Nine Point Radial Distortion Problem
- The minimal problem of simultaneous estimation of fundamental matrix and two different radial distortion parameters for two uncalibrated cameras and nine image point correspondences has been successfully solved in floating point arithmetic only recently [4].
- The authors automatic procedure starts with simplified four polynomial equations in four unknowns.
- First, the generator also generates all monomial multiples of the initial polynomial equations up to total degree eight.
- After the G-J elimination of the corresponding 179× 212 matrix (in fact 179× 203 matrix is sufficient) all necessary polynomial qi are obtained and the action matrix Mf31 (Mλ2 ) is constructed.
- The authors have compared their generated solver with the original solver proposed in [4] which uses special technique for improving the numerical stability based on changing the basis B and also with the “one elimination solver” (the same solver as in [4]) but without this basis selection.
6.3 Elimination template(s) size
- The results for these three minimal problems together with the results for the two previously discussed problems are shown in Table 1.
- For all these problems the authors have obtained smaller or the same size elimination templates than those used in original solvers.
6.4 Computation time
- The authors have implemented the generator in MATLAB.
- For several problems the authors have tested, the generator running time was from nine seconds to two minutes.
- Running times of the resulting automatically generated online solvers were in milliseconds.
7 Conclusion
- The authors have proposed an automatic procedure for generating Gröbner basis solvers for an interesting problems which appear in computer vision and elsewhere.
- This automatic generator can be easily used even by non-experts to solve their own new problems.
- The input to the generator is a system of polynomial equations with a finite number of solutions and the output is the Matlab or C code which computes solutions to this system for concrete coefficients.
- The authors generator constructs efficient and numerically stable solvers which are comparable or outperform known manually constructed solvers in acceptable time.
- The automatic generator is available at http://cmp.felk.cvut.cz/minimal.
Did you find this useful? Give us your feedback
Citations
278 citations
193 citations
Cites methods from "Automatic Generator of Minimal Prob..."
...We use our own Gröbner basis solver generator, which follows the idea presented in [10]....
[...]
...3 For details about the Gröbner basis method, the reader is referred to [4] and [10]....
[...]
141 citations
Cites methods from "Automatic Generator of Minimal Prob..."
...Therefore, we used an automatic generator of Grobner basis solver [4] to obtain the final equation....
[...]
141 citations
131 citations
Cites background or methods from "Automatic Generator of Minimal Prob..."
...[33] in that it only requires the user to specify the problem equations and then generates stand-alone MATLAB code that can be used to solve arbitrary problem instances....
[...]
...[33], where the authors presented an automatic method for generating polynomial solvers....
[...]
...) The solvers generated using [33] are built on the action matrix method that reduces the polynomial equation system to an eigenvalue problem....
[...]
...[33] (*) 238× 290 223× 290 154× 210 Rel....
[...]
...For a more thorough review of the action matrix method and how it has been applied in computer vision we recommend [37], [33] and [9]....
[...]
References
15,558 citations
14,282 citations
"Automatic Generator of Minimal Prob..." refers background in this paper
...These are important problems with a broad range of applications [10]....
[...]
3,332 citations
2,077 citations
1,726 citations