Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A toy library for Structure from Motion using OpenCV 2.3+
branch: master

Toy Structure From Motion Library using OpenCV


To compile use CMake:


How to make

  • Optionally build SSBA-3.0, by compiling it from '3rdparty' directory, or use "-DUSE_SSBA=OFF" with cmake.
  • If SSBA will not be used, the internal OpenCV bundle adjuster will be used, but I’ve had better luck with SSBA (I may be using the OpenCV bundle adjuster wrong, though).

On MacOS

mkdir build
cd build
cmake -DSSBA_LIBRARY_DIR=../../SSBA-3.0/build -G "Xcode" ..
open SfMToyExample.xcodeproj

On Linux

mkdir build
cd build
cmake -SSBA_LIBRARY_DIR=../../SSBA-3.0/build -G "Unix Makefiles" ..

On Windows

Use Cmake's GUI to create a MSVC solution, and build it.




USAGE: SfMToyUI.exe <path_to_images> [use rich features (RICH/OF) = RICH] [use GPU (GPU/CPU) = GPU] [down/upscale factor = 1.0]


Here's a place with some standard datasets for SfM: Also, you can use the "Crazy Horse" (A national memorial site in South Dakota) dataset, that I pictured myself, included in the repo.


  1. Multiple View Geometry in Computer Vision, Hartley, R. I. and Zisserman, A., 2004, Cambridge University Press []
  2. Modeling the World from Internet Photo Collections, N. Snavely, S. M. Seitz, R. Szeliski, IJCV 2007 []
  3. Triangulation, R.I. Hartley, P. Strum, 1997, Computer vision and image understanding
  4. Recovering baseline and orientation from essential matrix, B.K.P. Horn, 1990, J. Optical Society of America []


  • If you get linker errors "mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Visualization.obj", you must make sure you are compiling vs. the right VTK static libs (Debug have "-gd" postfix, Release don't).
Something went wrong with that request. Please try again.