forked from openMVG/openMVG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
144 changed files
with
14,985 additions
and
2,820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,8 @@ | |
*.toc | ||
*.bbl | ||
*.blg | ||
*.cbp* | ||
*.layout* | ||
*~ | ||
*.pyc | ||
*.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: cpp | ||
|
||
compiler: | ||
- gcc | ||
|
||
install: sudo apt-get install cmake libpng-dev libjpeg8-dev libxxf86vm1 libxxf86vm1 libxxf86vm-dev x11proto-xf86vidmode-dev libxrandr-dev | ||
|
||
before_script: | ||
- cd .. | ||
- mkdir build | ||
- cd build | ||
- cmake -DCMAKE_BUILD_TYPE=release . ../openMVG/src | ||
|
||
script: | ||
- make | ||
- make test | ||
|
||
branches: | ||
only: | ||
- develop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ Renaud Marlet <[email protected]> | |
ySalaun | ||
bduisit | ||
ORNis | ||
fcastan | ||
|
||
------------- | ||
OpenMVG authors would thanks the libmv authors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
docs/sphinx/rst/openMVG/linear_programming/linfinityCV.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
######################################################## | ||
L infinity solvers for computer vision | ||
######################################################## | ||
|
||
openMVG propose Linear programming based solver for various problem in computer vision by minimizing of the maximal error the residuals between observations and estimated parameters (The L infinity norm). | ||
|
||
openMVG implements problems introduced by [LinfNorm]_ and generalized by [LinfNormGeneric]. | ||
|
||
Rather than considering quadratic constraints that require SOCP (Second Orde Cone Programming) we consider their LP (linear program) equivalent. It makes usage of residual error expressed with absolute error ( ``|a|<b`` inequality is transformed in two linear inequalities ``a<b`` and ``-b<-a``. It makes the solving faster and constraint easier to express (see. [Arnak]_ for more explanation). | ||
|
||
- N-view triangulation [LinfNorm]_, | ||
- Resection or pose matrix estimation [LinfNorm]_, | ||
- Estimation of translations and structure from known rotations, | ||
|
||
- two formulation are implemented, | ||
|
||
- the simple one [LinfNorm]_, | ||
- the robust based on slack variables [OlssonDuality]_. | ||
|
||
- Registration of relative translations to compute global translations [ICCV13]_, | ||
|
||
- using triplets of translations. | ||
|
||
|
||
|
||
.. [LinfNorm] L infinity Minimization in Geometric Reconstruction Problems. Richard I. Hartley, Frederik Schaffalitzky. CVPR 2004. | ||
.. [LinfNormGeneric] "Multiple-View Geometry under the L infty Norm." Authors: Fredrik Kahl, Richard Hartley. 2008. and "Multiple View Geometry and the L infty -norm". Fredrik Kahl. ICCV 2005. | ||
.. [Arnak] Robust estimation for an inverse problem arising in multiview geometry. Arnak S. Dalalyan, Renaud Keriven. In J. Math. Imaging Vision, 2012. | ||
.. [OlssonDuality] Outlier Removal Using Duality. Carl Olsson, Anders Eriksson and Richard Hartley, Richard. CVPR 2010. | ||
.. [ICCV13] Global Fusion of Relative Motions for Robust, Accurate and Scalable Structure from Motion. Pierre Moulon, Pascal Monasse and Renaud Marlet. ICCV 2013. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
************************* | ||
linear programming | ||
************************* | ||
|
||
Linear programming [LP]_ is a technique for the optimization of a linear objective function, subject to linear equality and linear inequality constraints such as: | ||
|
||
.. math:: | ||
\begin{align} & \text{maximize} && \mathbf{c}^\mathrm{T} \mathbf{x}\\ | ||
& \text{subject to} && A \mathbf{x} \leq \mathbf{b} \\ | ||
& \text{and} && \mathbf{x} \ge \mathbf{0} \end{align} | ||
where ``x`` represents the vector of variables (to be determined), ``c`` and ``b`` are vectors of (known) coefficients, ``A`` is a (known) matrix of coefficients. | ||
|
||
openMVG linear programming tools | ||
--------------------------------- | ||
|
||
openMVG provides tools to: | ||
|
||
- configure Linear programs (LP container), | ||
- solve Linear Programs (convex or quasi convex ones). | ||
|
||
It results in a collection of L infinity based solver for computer vision problems. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
linfinityCV.rst | ||
|
||
|
||
openMVG linear program container | ||
--------------------------------- | ||
|
||
openMVG provides a generic container for LP (Linear Programming problems) that can be dense of sparse. | ||
|
||
.. code-block:: c++ | ||
|
||
// Dense LP | ||
LP_Constraints | ||
// Sparse LP | ||
LP_Constraints_Sparse | ||
|
||
|
||
It allows to embed: | ||
|
||
- objective function ``c`` and the problem type (minimization or maximization), | ||
- constraints (coefficients ``A``, Sign, objective value ``b``), | ||
- bounds over ``x`` parameters (<=, =, >=). | ||
|
||
openMVG linear program solvers | ||
--------------------------------- | ||
|
||
openMVG provide access to different solvers (not exhaustive): | ||
|
||
- OSI_CLP (COIN-OR) project, | ||
- MOSEK commercial, free in a research context. | ||
|
||
Those solver have been choosen due to the stability of their results and ability to handle large problems without numerical stability (LPSolve and GPLK have been discarded after extensive experiments). | ||
|
||
I refer the reader to openMVG/src/openMVG/linearProgramming/linear_programming_test.cpp to know more. | ||
|
||
openMVG linear programming module usage | ||
------------------------------------------- | ||
|
||
The linear programming module of openMVG can be used for: | ||
|
||
- solve classical linear problem (optimization), | ||
- test the feasibility of linear problem, | ||
- optimize upper bound of feasible problem (quasi-convex linear programs). | ||
|
||
**classical linear problem solving (optimization)** | ||
|
||
Here an example of usage of the framework: | ||
|
||
.. code-block:: c++ | ||
|
||
// Setup the LP (fill A,b,c and the constraint over x) | ||
LP_Constraints cstraint; | ||
BuildLinearProblem(cstraint); | ||
|
||
// Solve the LP with the solver of your choice | ||
std::vector<double> vec_solution(2); | ||
#if OPENMVG_HAVE_MOSEK | ||
MOSEK_SolveWrapper solver(2); | ||
#else | ||
OSI_CLP_SolverWrapper solver(2); | ||
#endif | ||
// Send constraint to the LP solver | ||
solver.setup(cstraint); | ||
|
||
// If LP have a solution | ||
if (solver.solve()) | ||
// Get back estimated parameters | ||
solver.getSolution(vec_solution); | ||
|
||
**Linear programming, feasible problem** | ||
|
||
openMVG can be use also to test only the feasibility of a given LP | ||
|
||
|
||
.. math:: | ||
\begin{align} & \text{find} && \mathbf{x}\\ | ||
& \text{subject to} && A \mathbf{x} \leq \mathbf{b} \\ | ||
& \text{and} && \mathbf{x} \ge \mathbf{0} \end{align} | ||
**Linear programming, quasi convex optimization** | ||
|
||
openMVG used a lot of L infinity minimisation formulation. | ||
Often the posed problems are quasi-convex and dependent of an external parameter that we are looking for (i.e the maximal re-projection error for which the set of contraint is still feasible). | ||
|
||
|
||
Optimization of this upper bound parameter can be done by iterating over all the possible value or by using a bisection that reduce the search range at each iteration. | ||
|
||
.. code-block:: c++ | ||
|
||
Require: gammaLow, gammUp (Low and upper bound of the parameter to optimize) | ||
Require: the LP problem (cstraintBuilder) | ||
Ensure: the optimal gamma value, or return infeasibility of the contraints set. | ||
|
||
BisectionLP( | ||
LP_Solver & solver, | ||
ConstraintBuilder & cstraintBuilder, | ||
double gammaUp = 1.0, // Upper bound | ||
double gammaLow = 0.0, // lower bound | ||
double eps = 1e-8, // precision that stop dichotomy | ||
const int maxIteration = 20) // max number of iteration | ||
{ | ||
ConstraintType constraint; | ||
do | ||
{ | ||
++k; // One more iteration | ||
|
||
double gamma = (gammaLow + gammaUp) / 2.0; | ||
|
||
//-- Setup constraint and solver | ||
cstraintBuilder.Build(gamma, constraint); | ||
solver.setup( constraint ); | ||
|
||
//-- Solving | ||
bool bFeasible = solver.solve(); | ||
|
||
//-- According feasibility update the corresponding bound | ||
//-> Feasible, update the upper bound | ||
//-> Not feasible, update the lower bound | ||
(bFeasible) ? gammaUp = gamma; : gammaLow = gamma; | ||
|
||
} while (k < maxIteration && gammaUp - gammaLow > eps); | ||
} | ||
|
||
|
||
|
||
.. [LP] http://en.wikipedia.org/wiki/Linear_programming |
Oops, something went wrong.