wilsonkl / SfM_Init

code for solving global structure from motion problem in the ECCV'14 paper "Robust Global Translations with 1DSfM"
Other
171 stars 60 forks source link

SfM Init User's Manual

copyright 2012-2014 Kyle Wilson (wilsonkl@cs.cornell.edu)

based on the global structure from motion work with Noah Snavely

Introduction:

SfM Init is a toolkit for solving some parts of a global Stucture from Motion pipeline. Such a pipeline would typically reconstruct the 3D (sparse) geometry of some scene given many photos with the following steps:

  1. Feature Detection
  2. Feature Matching
  3. Two View Model Estimation
  4. Solve for Globally Consistant Camera rotations (wrappers included)
  5. Solve for Globally Consistant Camera positions (included)
  6. Refine the Model through Bundle Adjustment

SfM Init goes from pairwise geometry to a good guess of global geometry, which is then the initialization to bundle adjustment. SfM Init does not ship with a system for computing pairwise models or with a bundle adjustor.

SfM Init uses the excellent Rotations Graph Averaging package by Chatterjee and Govindu [2]. This is available from their project webpage. SfM Init only provides wrappers to call this code. [Update: this code is temporarily unavailable from the authors. Venu Govindu has given me permission to temporarily distribute it here until their server problem is fixed.]

Conditions of Use

SfM Init is distributed under a Simplified BSD / 2-clause license. If you use SfM Init for a publication, please cite the following paper:

Kyle Wilson and Noah Snavely. Robust Global Translations with 1DSfM. ECCV 2014.

What's Included

SfM Init is distributed as a python package. Some of the key computations are written in C++ and are wrapped in via cython. This should be transparent to the user.

This toolkit includes a wrapper to Chatterjee and Govindu's rotations averaging code, as well 1DSfM translations problem outlier detection and a chordal distance based translations solver.

Examples of how to use SfM Init are in the scripts directory. In particular, scripts/eccv_demo.py shows how to run all the steps of the pipeline described in [1] on the datasets provided at the 1DSfM project page. Look in scripts/coords_demo.py for some examples of how the coordinate systems in 1DSfM are used.

Before You Begin

SfM Init is python based, and depends on the following standard python packages --- python 2.7, numpy, and scipy. Additionally, to compile the C++ numeric routines, it requires cython.

The translations solver requires the Ceres Solver nonlinear least squares package.

Chatterjee and Govindu's rotations averaging code can be found at their project page. Unzip the contents of this tar file into the rotsolver directory.

Finally, to compile the numerics routines, run the following from SfM Init's root directory:

> python setup.py build_ext --inplace

If this fails, check the compile and link paths in setup.py to be sure that cython can see the Ceres include and lib files, as well as Eigen and the SuiteSparse libs that Ceres depends on.

The most common causes of build failure reported to the authors come down to very old versions of python/cython or libceres not being visible during linking.

File Formats

Running the SfM Init pipeline in scripts/eccv_demo.py requires several files describing reconstructed two view models. Our datasets are available on our project page. Note that the photos and data files are distributed separately. The dataset files describe a single connected component, but all images related to each Landmark are given, in case these are useful in another context. If the following descriptions are insufficient, please also look at scripts/coords_demo.py for some further examples.

Input files:

Output formats:

Other included files:

Contact

Please email Kyle Wilson (wilsonkl@cs.cornell.edu) with any questions, comments, or bug reports.

References

[1] Kyle Wilson and Noah Snavely. Robust Global Translations with 1DSfM. ECCV 2014.

[2] Avishek Chatterjee and Venu Madhav Govindu. Efficient and Robust Large-Scale Rotation Averaging. ICCV 2013.

[3] Noah Snavely, Steven M. Seitz, and Richard Szeliski. Photo Tourism: Exploring Photo Collections in 3D. SIGGRAPH Conf. Proc., 2006.