# plucker-pnl **Repository Path**: bobin007/plucker-pnl ## Basic Information - **Project Name**: plucker-pnl - **Description**: No description available - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-11-14 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # plucker-pnl ## Introduction Perspective-n-Point(PnP) is the problem of estimating the pose of a calibrated camera given a set of n 3D points in the world and their corresponding 2D projections in the image.(https://en.wikipedia.org/wiki/Perspective-n-Point) We extend this methods to 3D-2D lines, which is called as Perspective-n-Line(PnL). Moreover, we can combine 3D-2D point pair and 3D-2D line pair together to solve the camera pose. These are implemented in pnpl.cpp(h) as a graph optimization and solved by g2o. We also use plucker coordinates and plucker matrix to estimate the pose. By converting the end point of line to coordinates and projecting 3d line to normalized image line, we can minimize the line error. see (Přibyl B, Zemčík P, Čadík M. Camera Pose Estimation from Lines using Pl\" ucker Coordinates[J]. arXiv preprint arXiv:1608.02824, 2016.) The pnp.cpp(h) contains close form solutions for camera position with known camera attitude(rotation). Note that we need at least 2 point pair in pnpTrans() while at least 3 line pair in pnlTrans(). #Prerequisites Prerequisites needed for compiling PnPL using c++: - OpenCV (http://opencv.org) - g2o (https://github.com/RainerKuemmerle/g2o) Note that we oply use opencv data structures to store datas. You can change the variable type in codes if you really don't want to use opencv. # How to run - Linux ``` mkdir build cd build cmake .. make ``` - Windows You can use CMake-GUI to build your project. We provide two demos to show how to use, 1. demo_pnpl solves camera position and rotation (6DoF) with point pairs and line pairs, it needs g2o. 2. demo_pnptrans solves only camera position(3DoF) with point pairs and line pairs in close form.