ktuite / OpenSfM

Open Source Structure from Motion pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenSfM

Structure from Motion library written in Python on top of OpenCV.

Dependencies

Installing dependencies on MacOSX

Use

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

Be sure to update your PYTHONPATH to include /usr/local/lib/python2.7/site-packages where OpenCV has been installed:

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

Installing dependencies on Ubuntu

  1. OpenCV - Install by following the steps in the Ubuntu OpenCV installation guide. An alternative instruction tested for Ubuntu 10.04 can be found at OpenCV Docs. OpenCV requires GCC and CMake among other things.

  2. Ceres solver - Build Ceres according the documentation. Make sure to read the Linux note, follow the shared library instructions and compile Ceres with the -fPIC option. Install Ceres from the ceres-bin directory after make by:

    sudo make install
    
  3. Boost Python - Install through apt-get:

    sudo apt-get install libboost-python-dev
    
  4. NumPy, networkx, PyYaml, exifread - Install pip and then run the following from the root of the project:

    sudo pip install -r requirements.txt
    
  5. SciPy - Install gfortran through apt-get and then install SciPy with:

    sudo apt-get install gfortran
    sudo pip install scipy
    

Building inplace using setup.py

python setup.py build_clib
python setup.py build_ext --inplace

Building using CMake

mkdir build
cd build
cmake ../opensfm/src
make

Running

An example dataset is available at data/berlin.

  1. Put some images in data/DATASET_NAME/images/
  2. Put config.yaml in data/DATASET_NAME/config.yaml
  3. Go to the root of the project and run bin/run_all data/DATASET_NAME
  4. Start an http server from the root with python -m SimpleHTTPServer
  5. Browse http://localhost:8000/viewer/reconstruction.html#file=/data/DATASET_NAME/reconstruction.json.

About

Open Source Structure from Motion pipeline

License:BSD 2-Clause "Simplified" License


Languages

Language:JavaScript 75.9%Language:Python 17.6%Language:HTML 4.1%Language:C++ 2.3%Language:Shell 0.1%