Skip to content
forked from terzakig/sqpnp

C++ Implementation of the SQPnP algorithm

License

Notifications You must be signed in to change notification settings

oppenfuture/sqpnp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQPnP

C++ Implementation of the SQPnP algorithm.

The algorithm is the generic PnP solver described in the paper "A Consistently Fast and Globally Optimal Solution to the Perspective-n-Point Problem" by G. Terzakis and M. Lourakis. For more intuition, refer to the supplementary material here.

Required libraries

SQPnP requires the Eigen library to build. Besides eigendecomposition, the use of Eigen is confined to matrix addition, transposition and multiplication. Choosing Eigen was motivated by its increasing popularity and lightweight character. There are also three examples of using the solver in this repository:

  1. ) one that uses OpenCV, just for the sake of demonstrating the initialization of SQPnP with cv::Point_<> and cv::Point3_<> structures,
  2. ) another in which data points are copied from plain 2D arrays, and
  3. ) a third which demonstrates SQPnP within RANSAC.

Build will proceed with either one of 1) or 2), depending on whether OpenCV is found or not. Example 3) uses the RansacLib template-based library, (part of) which is included in this repository.

Build

Create a build directory in the root of the cloned repository and run cmake:

mkdir build

cd build

cmake ..

or, for a release build,

cmake .. -DCMAKE_BUILD_TYPE=Release

The latter will allow for more accurate timing of average execution time. Finally build everything:

make

To run the PnP example, once in the build directory,

./examples/sqpnp_example

To run the robust estimation example, from the build directory, ./examples/robust_sqpnp_example data/K.txt data/32D.txt

Cite as

If you use this code in your published work, please cite the following paper:

@inproceedings{terzakis2020SQPnP,
title={A Consistently Fast and Globally Optimal Solution to the Perspective-n-Point Problem},
author={George Terzakis and Manolis Lourakis},
booktitle={European Conference on Computer Vision},
pages={478--494},
year={2020},
publisher={Springer International Publishing}
}

About

C++ Implementation of the SQPnP algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • C++ 98.7%
  • CMake 1.3%