• Stars
    star
    529
  • Rank 83,810 (Top 2 %)
  • Language
    C++
  • Created almost 13 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A toy library for Structure from Motion using OpenCV

Toy Structure From Motion Library using OpenCV

This is a reference implementation of a Structure-from-Motion pipeline in OpenCV, following the work of Snavely et al. [2] and Hartley and Zisserman [1].

Note: This is not a complete and robust SfM pipeline implementation. The purpose of this code is to serve as a tutorial and reference for OpenCV users and a soft intro to SfM in OpenCV. If you are looking for a more complete solution with many more options and parameters to tweak, check out the following:

SfM-Toy-Library is now using OpenCV 3, which introduced many new convenience functions to Structure from Motion (see my blog post for details), making the implementation much cleaner and simpler.

Ceres solver was chosen to do bundle adjustment, for its simple API, straightforward modeling of the problem and long-term support.

Doxygen-style documentation comments appear throughout.

Compile

To compile use CMake: http://www.cmake.org

Prerequisite

How to make

On OSX Using XCode

Get Boost and Ceres using homebrew: brew install boost ceres-solver (you will need to tap homebrew/science for Ceres)

mkdir build
cd build
cmake -G "Xcode" ..
open SfMToyExample.xcodeproj

On Linux (or OSX) via a Makefile

Obtain Boost (with e.g. apt-get install libboost-all-dev) and Ceres (probably need to clone and compile), or on OSX view homebrew as mentioned before.

mkdir build
cd build
cmake -G "Unix Makefiles" ..
make 

On Windows

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

Usage

Execute

USAGE ./build/SfMToyUI [options] <input-directory>
  -h [ --help ]                   produce help message
  -d [ --console-debug ] arg (=2) Debug output to console log level (0 = Trace,
                                  4 = Error).
  -v [ --visual-debug ] arg (=3)  Visual debug output to screen log level (0 = 
                                  All, 4 = None).
  -s [ --downscale ] arg (=1)     Downscale factor for input images
  -p [ --input-directory ] arg    Directory to find input images

Datasets

Here's a place with some standard datasets for SfM: http://cvlabwww.epfl.ch/data/multiview/denseMVS.html

Also, you can use the "Crazy Horse" (A national memorial site in South Dakota) dataset, that I pictured myself, included in the repo.

Other

Some relevant blog posts from over the years:

References

  1. Multiple View Geometry in Computer Vision, Hartley, R. I. and Zisserman, A., 2004, Cambridge University Press [http://www.robots.ox.ac.uk/~vgg/hzbook/]
  2. Modeling the World from Internet Photo Collections, N. Snavely, S. M. Seitz, R. Szeliski, IJCV 2007 [http://phototour.cs.washington.edu/ModelingTheWorld_ijcv07.pdf]
  3. Triangulation, R.I. Hartley, P. Strum, 1997, Computer vision and image understanding [http://perception.inrialpes.fr/Publications/1997/HS97/HartleySturm-cviu97.pdf]
  4. Recovering baseline and orientation from essential matrix, B.K.P. Horn, 1990, J. Optical Society of America [http://people.csail.mit.edu/bkph/articles/Essential_Old.pdf]
  5. On benchmarking camera calibration and multi-view stereo for high resolution imagery. Strecha, Christoph, et al. IEEE Computer Vision and Pattern Recognition (CVPR) 2008. [http://infoscience.epfl.ch/record/126393/files/strecha_cvpr_2008.pdf]

More Repositories

1

obs-backgroundremoval

An OBS plugin for removing background in portrait images (video), making it easy to replace the background when screen recording.
CMake
1,730
star
2

HeadPosePnP

Head pose estimation using PnP
C++
128
star
3

FoodcamClassifier

A Bag of Visual Words food classifier for Media Lab's FoodCam
C++
115
star
4

CurveMatching

Matching 2D curves in OpenCV
CMake
75
star
5

CurveDeformationMLS

2D Shape/Curve deformation using Moving Least Sqaures
C++
51
star
6

HHParticleFilter

Heap&Hogg's hand curve tracking particle filter [OpenCV,c++]
C++
47
star
7

HeadReplacement

C++
44
star
8

OpenHPE

A hand pose estimator using model fitting by finding minimal energy, using OpenCV and tnc.c library.
C
42
star
9

ofxNaturalFeatureTracker

A natural features image tracker, detector and Augmented Reality engine
C++
18
star
10

morethantechnical

Automatically exported from code.google.com/p/morethantechnical
C++
17
star
11

ATmega88-bootloader

A bootloader for ATmega88 to use with Arduino software
C
14
star
12

obs-localvocal

OBS plugin for local speech and text AI processing routines
CMake
9
star
13

KinectPuppeteering

Animating 3D Meshes using the Kinect
C++
8
star
14

obs-cleanstream

CleanStream is an OBS plugin that uses AI to clean live audio streams from unwanted words and utterances
C++
6
star
15

wikilosophy

Tools for parsing wikipedia articles' linkage network
Python
4
star
16

ExercisesCollection

A collection of coding exercises
C++
4
star
17

HeadFollower

The source code for the PoCoMo project
Java
4
star
18

Docker4MLTutorial

A hands on tutorial on Docker and AWS Lambda for Machine Learning applications.
Jupyter Notebook
3
star
19

telegram-serverless-ts-bot-tutorial

Telegram Typescript Serverless Bot Tutorial
TypeScript
3
star
20

KinectPlugin

A browser plugin for Kinect
C++
3
star
21

audiograma

An open source Audiogram maker - audio for your eyes!
HTML
2
star
22

KinectAtHomeExtension

Browser extension part of the Kinect@Home project
C++
2
star
23

obs-plugin-workshop

A set of tutorials on authoring OBS plugins from the ground up
CMake
1
star
24

TabParser

A textual guitar tablature parser and convert tools
Java
1
star