OpenGV
A library for solving calibrated central and non-central geometric vision problems
The OpenGV library

Important note: If you are only interested in using the library under Matlab, now there is a precompiled mex-library for 64-bit systems available. You can download it from:

Windows: http://laurentkneip.github.io/publications/opengv.mexw64
Mac OSX: http://laurentkneip.github.io/publications/opengv.mexmaci64

These versions have been added around March 2016, so please be aware that later additions may not be included in this distribution. You can go immediately to Use under Matlab to receive further instructions on the Matlab interface.

The OpenGV library aims at unifying geometric computer vision algorithms for calibrated camera pose computation within a single efficient C++-library. OpenGV stands for Open Geometric Vision. It contains classical central and more recent non-central absolute and relative camera pose computation algorithms, as well as triangulation and point-cloud alignment functionalities, all extended by non-linear optimization and RANSAC contexts. It contains a flexible C++-interface as well as Matlab and Python wrappers, and eases the comparison of different geometric vision algorithms. A benchmark to compare the various solutions for one particular problem against each other is included in the Matlab stuff.

The library is described in the paper (Please cite if you use it for your research!):

  • L. Kneip, P. Furgale, "OpenGV: A unified and generalized approach to real-time calibrated geometric vision", Proc. of The IEEE International Conference on Robotics and Automation (ICRA), Hong Kong, China. May 2014.

The library has been developped in the context of the following papers.

  • L. Kneip, D. Scaramuzza, R. Siegwart, "A Novel Parametrization of the Perspective-Three-Point Problem for a Direct Computation of Absolute Camera Position and Orientation", Proc. of The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Colorado Springs, USA. June 2011.
  • L. Kneip, M. Chli, R. Siegwart, "Robust Real-Time Visual Odometry with a Single Camera and an IMU", Proc. of The British Machine Vision Conference (BMVC), Dundee, UK. August 2011.
  • T. Kazik, L. Kneip, J. Nikolic, M. Pollefeys, R. Siegwart, "Real-Time 6D Stereo Visual Odometry with Non-Overlapping Fields of View", Proc. of The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Providence, USA. June 2012.
  • L. Kneip, R. Siegwart, M. Pollefeys, "Finding the Exact Rotation Between Two Images Independently of the Translation", Proc. of The European Conference on Computer Vision (ECCV), Florence, Italy. October 2012.
  • L. Kneip, P. Furgale, R. Siegwart, "Using Multi-Camera Systems in Robotics: Efficient Solutions to the NPnP Problem", Proc. of The IEEE International Conference on Robotics and Automation (ICRA), Karlsruhe, Germany. May 2013.
  • L. Kneip, S. Lynen, "Direct Optimization of Frame-to-Frame Rotation", Proc. of The International Conference on Computer Vision (ICCV), Sydney, Australia. December 2013.
  • L. Kneip, H. Li, "Efficient Computation of Relative Pose for Multi-Camera Systems", In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Columbus, USA. June 2014.
  • L. Kneip, H. Li, Y. Seo, "UPnP: An optimal O(n) solution to the absolute pose problem with universal applicability", In Proc. of The European Conference on Computer Vision (ECCV), Zurich, Switzerland. September 2014.

Please cite the OpenGV paper as well as the corresponding paper if you use OpenGV to work on a particular problem.

Getting started

OpenGV features the following set of algorithms:

  • Absolute camera pose computation:
    1. absolute pose computation with known rotation
    2. two P3P-algorithms (Kneip, Gao)
    3. generalized P3P
    4. the EPnP algorithm by Lepetit and Fua
    5. an extension of the EPnP algorithm to the non-central case (Kneip)
    6. the generalized absolute pose solver presented at ICRA 2013 (Kneip)
    7. non-linear optimization over n correspondences (both central and non-central)
    8. the UPnP algorithm presented at ECCV 2014 (both central and non-central, and minimal and non-minimal)
  • Relative camera-pose computation:
    1. 2-point algorithm for computing the translation with known relative rotation
    2. 2-point algorithm for deriving the rotation in a pure-rotation situation
    3. n-point algorithm for deriving the rotation in a pure-rotation situation
    4. 5-point algorithm by Stewenius
    5. 5-point algorithm by Nister
    6. 5-point algorithm to solve for rotations directly (by Kneip)
    7. 7-point algorithm
    8. 8-point algorithm by Longuet-Higgins
    9. 6-point algorithm by Henrik Stewenius for generalized relative pose
    10. 17-point algorithm by Hongdong Li
    11. non-linear optimization over n correspondences (both central and non-central)
    12. relative rotation as an iterative eigenproblem (by Kneip)
    13. generalized reltive rotation for multi-camera systems as an iterative eigenproblem (by Kneip)
  • Two methods for point-triangulation
  • Arun's method for aligning point clouds
  • Generic sample-consensus problems for most algorithms useable with Ransac
  • Math tools:
    1. Generic Sturm-sequence implementation for numerical root-finding
    2. Algebraic root finding
    3. Cayley rotations
  • Unit/Benchmarking tests for all algorithms
  • Matlab interface
  • Python interface

The aim of OpenGV is to make these algorithms accessible to real-time computer vision and robotics-related tasks, that require efficient pose computation of calibrated cameras. It is also intended to serve as a benchmarking framework for testing and comparing different solutions to geometric-vision problems. The library realizes a clean separation between 2D-2D, 2D-3D, and 3D-3D registration tasks. It thus provides a somewhat missing block between image-processing libraries (e.g. OpenCV) and more exhaustive non-linear optimization frameworks (e.g. g2o, ceres). By working exclusively with 3D unit bearing-vectors, it allows to be applied in conjunction with any optical projection system.

Please consult the following sub-pages to get a step-by-step introduction to the library: