Skip to content

Commit

Permalink
merge develop. 0.5 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Mar 4, 2014
2 parents 1646476 + d3fb39a commit 282484e
Show file tree
Hide file tree
Showing 144 changed files with 14,985 additions and 2,820 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
*.toc
*.bbl
*.blg
*.cbp*
*.layout*
*~
*.pyc
*.db
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "src/dependencies/OpenExif"]
path = src/dependencies/OpenExif
url = https://github.com/openMVG-thirdparty/OpenExif.git
[submodule "src/dependencies/osi_clp"]
path = src/dependencies/osi_clp
url = https://github.com/openMVG-thirdparty/osi_clp.git
21 changes: 21 additions & 0 deletions .travis.yml
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

1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Renaud Marlet <[email protected]>
ySalaun
bduisit
ORNis
fcastan

-------------
OpenMVG authors would thanks the libmv authors
Expand Down
9 changes: 9 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ Setup the required external library.
$ cd openMVG_Build
$ cmake -DCMAKE_BUILD_TYPE=RELEASE . ../openMVG/src/

=> In order to use the MOSEK backend for the linear programming oepnMVG module
- Check that you have an uptodate MOSEK licence, else openMVG MOSEK unit test will fail.

$ cmake -DCMAKE_BUILD_TYPE=RELEASE
-DMOSEK_SEARCH_HEADER="~/Documents/Lib/mosek/6/tools/platform/linux64x86/h"
-DMOSEK_SEARCH_LIB="~/Documents/Lib/mosek/6/tools/platform/linux64x86/bin"
. ../openMVG/src/


If you want have an IDE openable project with codeblocks:
$ cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE . ../openMVG/src/

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Building

See [BUILD](https://github.com/openMVG/openMVG/raw/master/BUILD) text file

Continuous integration (master, develop branch, linux 64 bits):
Continuous integration (develop branch, linux 64 bits, BUILD + UNIT TESTING):

[![Build Status](https://drone.io/github.com/openMVG/openMVG/status.png)](https://drone.io/github.com/openMVG/openMVG/latest)
[![Build Status](https://travis-ci.org/openMVG/openMVG.png?branch=develop)](https://travis-ci.org/openMVG/openMVG)

-------
License
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/rst/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
# built documents.
#
# The short X.Y version.
version = '0.4'
version = '0.5'
# The full version, including alpha/beta/rc tags.
release = '0.4'
release = '0.5'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/rst/dependencies/glfw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ USAGE

openMVG uses GLFW library in order to provide an easy way to create openGL windows context.

==========
===========
Description
==========
===========

"[GLFW]_ is an Open Source, multi-platform library for creating windows with OpenGL contexts and managing input and events.
It is easy to integrate into existing applications and does not lay claim to the main loop.
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/rst/dependencies/openExif.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ USAGE

openMVG uses OpenEXIF library in order to read JPEG EXIF metadata.

==========
===========
Description
==========
===========

"[OpenExif]_ is an object-oriented library for accessing Exif formatted JPEG image files. The toolkits allow for creating, reading, and modifying the metadata in the Exif file. It also provides mean of getting and setting the main image and the thumbnail image.
"
Expand Down
8 changes: 4 additions & 4 deletions docs/sphinx/rst/dependencies/osi_clp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ openMVG uses the [OSI]_ and the [CLP]_ solver in order to solve linear programs

CLP has been choosen because it is known to support problems of up to 1.5 million constraints [CLP FAQ]_.

[LPSOLVE]_ have been tested but tests shown that it is less reliable (sometimes, there is no convergence to a solution).
[LPSOLVE]_ has been tested but tests shown that it is less reliable (sometimes, there is no convergence to a solution).

==========
===========
Description
==========
===========

[OSI]_
Osi (Open Solver Interface) provides an abstract base class to a generic linear programming (LP) solver, along with derived classes for specific solvers. Many applications may be able to use the Osi to insulate themselves from a specific LP solver. (CLP and MOSEK backend are supported in openMVG).
Expand All @@ -25,5 +25,5 @@ Description
.. [LP] http://en.wikipedia.org/wiki/Linear_programming
.. [OSI] https://projects.coin-or.org/Osi
.. [CLP] https://projects.coin-or.org/Clp/wiki
.. [CLP FAQ] https://projects.coin-or.org/Clp/wiki/FAQ
.. [CLP_FAQ] https://projects.coin-or.org/Clp/wiki/FAQ
.. [LPSOLVE] http://lpsolve.sourceforge.net/5.5/
25 changes: 14 additions & 11 deletions docs/sphinx/rst/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Introduction
==================
OpenMVG (Multiple View Geometry) is a library for computer-vision scientists and especially
targeted to the Multiple View Geometry community. It is designed to provide an easy access to the
classical problem solvers in Multiple View Geometry and solve them accurately..
classical problem solvers in Multiple View Geometry and solve them accurately.

############################
Why another library
Expand All @@ -28,7 +28,7 @@ openMVG library overview

The openMVG library is cut in various modules:

* **Libraries**,
* **Libraries, core**,

* comes with unit tests that assert algorithms results and show how use the code.

Expand All @@ -38,7 +38,11 @@ The openMVG library is cut in various modules:

* **Binaries**,

* softwares build to perform toolchain processing (features matching, Structure from Motion ...).
* softwares build to perform toolchain processing

* features matching in un-ordered photo collection,
* SfM: Structure from Motion,
* color harmonization of photo collection.

Contents:

Expand All @@ -47,21 +51,20 @@ Contents:

openMVG/openMVG.rst
openMVG_Samples/openMVG_Samples.rst
software/softwares.rst
patented/patented.rst
software/SfM/SfM.rst
testing/testing.rst
dependencies/external_libs.rst
third_party/third_party.rst
FAQ/FAQ.rst



############################
Acknowledgements
############################
openMVG authors would like to thank libmv authors for providing an inspiring base to design the
openMVG library. Authors also would like to thank Mikros Image and LIGM-Imagine laboratory
for support and authorization to make this library as an open-source project.
openMVG authors would like to thank:

- libmv authors for providing an inspiring base to design the openMVG library.
- Mikros Image and LIGM-Imagine laboratory for support and authorization to make this library as an open-source project.

############################
License
Expand All @@ -74,8 +77,8 @@ Please refer to the license file contained in the source for complete license de
Dependencies
############################
OpenMVG come as a standalone distribution, you don't need to install libraries to make it compiles
and run. Exception for the Linux library is made for the png, zlib and jpeg library in order to use
the one of the system.
and run.
On Linux the library will use if available the local png, zlib and jpeg libraries.

Indices and tables
==================
Expand Down
36 changes: 36 additions & 0 deletions docs/sphinx/rst/openMVG/linear_programming/linfinityCV.rst
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.
153 changes: 153 additions & 0 deletions docs/sphinx/rst/openMVG/linear_programming/lp.rst
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
Loading

0 comments on commit 282484e

Please sign in to comment.