Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
103 lines (63 sloc) 3.01 KB



OpenSfM code is available at Github. The simplest way to get the code is to clone the repository and its submodules with:

git clone --recursive

If you already have the code or you downloaded a release, make sure to update the submodules with:

cd OpenSfM
git submodule update --init --recursive

Install dependencies

OpenSfM depends on the following libraries that need to be installed before building it.

Installing dependencies on Ubuntu

If using Python 2, see this Dockerfile for the commands to install all dependencies on Ubuntu 16.04.

If using Python 3, follow the process here Dockerfile.python3.

The main steps are

  1. Install OpenCV, NumPy, SciPy using apt-get
  2. Install python requirements using pip
  3. Clone, build and install OpenGV following the receipt in the Dockerfile
  4. Build and Install the Ceres solver from its source using the -fPIC compilation flag.

Installing dependencies on MacOSX

Install OpenCV and the Ceres solver using:

brew tap homebrew/science
brew install opencv
brew install ceres-solver
sudo pip install -r requirements.txt

And install OpenGV using:

brew install eigen
git clone --recurse-submodules -j8
cd opengv/build
make install

Make sure you update your PYTHONPATH to include /usr/local/lib/python2.7/site-packages where OpenCV and OpenGV have been installed. For example with:

export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH


Note on OpenCV 3 When running OpenSfM on top of OpenCV version 3.0 the OpenCV Contrib modules are required for extracting SIFT or SURF features.

Building the library

Once the dependencies have been installed, you can build OpenSfM by running the following command from the main folder:

python build

or python3 build for a Python 3 build.

Building the documentation

To build the documentation and browse it locally use:

cd doc
make livehtml

and browse http://localhost:8001/