gurpreetshanky / pysfm

Structure from Motion Algorithms in Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Structure from Motion Algorithms in Python.

Eventually, this is intended to be a collection of factorization based structure from motion algorithms. Currently, it only contains a standard rigid factorization algorithm and a state of the art non-rigid shape basis factorization method (Dai et al. 2012) that won the best paper at CVPR2012.

NOTE: This is extremely beta, and no claim is made about the correctness of these implementations. There are likely bugs, and thus contributions and/or friendly comments are welcome. See below for contact information.


  • setuptools (you likely have this)
  • numpy
  • scipy
  • CVXOPT (for the shape-basis method)
  • matplotlib (for viewing results)
  • nose (if you want to run the test suite).


To run Dai et al. 2012 on an observation matrix W

import sfm

# Run Dai2012 with 3 basis shapes.
inferred_model = sfm.factor(W, n_basis = 3)

# Get the Fx3xN tensor of points in the
# cameras reference frame.
Ps = inferred_model.Ps

# To view the recovery (using matplotlib)


To contact the author email where FOO is replaced with the at symbol.


Structure from Motion Algorithms in Python.



Language:Python 100.0%