written by Noah Snavely (snavely@cs.cornell.edu)
based on the Photo Tourism work of Noah Snavely, Steven M. Seitz, (University of Washington) and Richard Szeliski (Microsoft Research)
For more information, see the Bundler homepage at http://www.cs.cornell.edu/~snavely/bundler/ or see the FAQ at http://www.cs.cornell.edu/~snavely/bundler/faq.html
Bundler is a structure-from-motion system for unordered image collections (for instance, images from the Internet). Bundler takes a set of images, image features, and image matches as input, and produces a 3D reconstruction of the camera and (sparse) scene geometry as output. The system, described in [1] and [2], reconstructs the scene incrementally, a few images at a time, using a modified version of the Sparse Bundle Adjustment package of Lourakis and Argyros [3] as the underlying optimization engine.
Currently, Bundler has been primarily compiled and tested under Linux (though it may also compile in Windows under Cygwin, and a Visual Studio solution file is also provided).
Bundler is distributed under the GNU General Public License. For information on commercial licensing, please contact the authors at the contact address below. If you use Bundler for a publication, please cite the following paper:
Noah Snavely, Steven M. Seitz, and Richard Szeliski. Photo Tourism: Exploring Photo Collections in 3D. SIGGRAPH Conf. Proc., 2006.
Included with the binary distribution is the Bundler executable (bin/bundler), as well as a number of other utility scripts and executables (in the bin/ directory). In addition, there are a number of example image sets (and example results) under the examples/ directory. A version of the approximate nearest neighbors (ANN) library of David M. Mount and Sunil Arya, customized for searching verctors of unsigned bytes, is also included.
A utility program for converting bundle files (.out) to the input required by Dr. Yasutaka Furukawa's PMVS multi-view stereo system (http://www.di.ens.fr/pmvs/) called Bundle2PMVS is also included. Finally, this distribution includes a program called RadialUndistort for generating undistorted images (based on the undistortion parameters estimated by Bundler).
You'll first need to download the Bundler distribution from GitHub:
or visit the Bundler homepage at
http://phototour.cs.washington.edu/bundler
and extract it into a directory (to be referred to as BASE_PATH).
You'll also need a feature detector components to get the system working. Assuming you will be using SIFT features generated by David Lowe's SIFT binary, you'll need to download that binary from
http://www.cs.ubc.ca/~lowe/keypoints/
and copy it to BASE_PATH/bin (making sure it is called 'sift', or 'siftWin32.exe' under Windows).
You'll also need the 'jhead' program installed, for computing focal lengths from Exif metadata. This is available, for instance, as the jhead package on Ubuntu.
Finally, make sure you have the ImageMagick library installed.
The utils/bundler.py script requires that you have Python and the Python Image Library (PIL) installed on your computer.
To make bundler, just type 'make' in the main bundler directory. Note that if you plan to run Bundler on large problems, you may wish to enable the use of the Ceres solver for bundle adjustment, which can improve speed over the default SBA bundle adjuster. To do so, edit the file 'src/Makefile' and uncomment the line
USE_CERES=true
Note that this assumes you have Ceres and its dependencies installed on your system. See the Ceres solver page at
https://code.google.com/p/ceres-solver/
for more information.
Finally, once Bundler is compiled, copy the approximate nearest neighbors (ANN) shared library at BASE_PATH/bin/libANN_char.so (Linux/cygwin) or BASE_PATH/bin/ann_1.1_char.dll (Windows VS2005) to a location in your LD_LIBRARY_PATH, or add BASE_PATH/bin to LD_LIBRARY_PATH with a command like (in bash):
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/bundler/bin
The easiest way to start using Bundler is to either use the provided RunBundler.sh bash script, or the included Python script (by Isaac Lenton), utils/bundler.py. Just execute either script in a directory with a set of images in JPEG format, and it will automatically run all the steps needed to run structure from motion on the images (assuming everything goes well). For RunBundler.sh, you may optionally provide a configuration file as a command line argument---see RunBundler.sh for a description of the configuration options available. Notably, you can choose to use Ceres when running Bundler.
To get help on using the Python script bundler.py:
bundler.py -h
To run bundler.py with verbose output on a single thread (this acts similar to the older RunBundler.sh bash script):
bundler.py --verbose --no-parallel
bundler.py can also be imported into your own Python modules to enable easy access to the bundler system. Type 'help(bundler)' at the python command prompt after importing bundler.py for more information.
The Bundler exectutable is actually the last in a sequence of steps that need to be run to reconstruct a scene. bundler.py takes care of all these steps for you, but it's useful to know what's going on. The main initial steps are to generate features and pairwise feature matches for the image set. Any type of image features can be used, but Bundler assumes the features are in the SIFT format, and so David Lowe's SIFT detector, available at http://www.cs.ubc.ca/~lowe/keypoints/, is probably the easiest to get working with Bundler (bundler.py assumes that SIFT is used). A list of images containing estimating focal length information also must be created. The four steps to creating a reconstruction are therefore:
Again, running the RunBundler.sh or bundler.py script is the easiest way to perform these steps. Steps 1-3 can also be invoked individually from functions contained in the bundler.py script.
Bundler itself is typically invoked as follows:
bundler list.txt --options_file options.txt
The first argument is the list of images to be reconstructed. Next, an options file containing settings to be used for the current run is given. The RunBundler.sh and bundler.py scripts create an options file that will work in many situations (and some of these options can be controlled by the configuration file passed to RunBundler.sh). Common options are described later in this document. To generate only the list of images, run:
bundler.py --extract-focal
Bundler produces files typically called 'bundle*.out' (we'll call
these "bundle files"). With the default commands, Bundler outputs a
bundle file called 'bundle
The bundle files contain the estimated scene and camera geometry have the following format:
# Bundle file v0.3
<num_cameras> <num_points> [two integers]
<camera1>
<camera2>
...
<cameraN>
<point1>
<point2>
...
<pointM>
Each camera entry
<f> <k1> <k2> [the focal length, followed by two radial distortion coeffs]
<R> [a 3x3 matrix representing the camera rotation]
<t> [a 3-vector describing the camera translation]
The cameras are specified in the order they appear in the list of images.
Each point entry
<position> [a 3-vector describing the 3D position of the point]
<color> [a 3-vector describing the RGB color of the point]
<view list> [a list of views the point is visible in]
The view list begins with the length of the list (i.e., the number of
cameras the point is visible in). The list is then given as a list of
quadruplets