【论文阅读】EPnP: An Accurate O(n) Solution to the PnP Problem

EPnP: An Accurate O(n) Solution to the PnP Problem

Opencv.solvePnP documentation

solvePnP

bool cv::solvePnP(
InputArray 	objectPoints,
InputArray 	imagePoints,
InputArray 	cameraMatrix,
InputArray 	distCoeffs,
OutputArray 	rvec,
OutputArray 	tvec,
bool 	useExtrinsicGuess = false,
int 	flags = SOLVEPNP_ITERATIVE 
)

Finds an object pose from 3D-2D point correspondences.
This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:

  • P3P methods (SOLVEPNP_P3P, SOLVEPNP_AP3P): need 4 input points to return a unique solution.
  • SOLVEPNP_IPPE Input points must be >= 4 and object points must be coplanar(共面).
  • SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation. Number of input points must be 4. Object points must be defined in the following order:
    point 0: [-squareLength / 2, squareLength / 2, 0]
    point 1: [ squareLength / 2, squareLength / 2, 0]
    point 2: [ squareLength / 2, -squareLength / 2, 0]
    point 3: [-squareLength / 2, -squareLength / 2, 0]
  • for all the other flags, number of input points must be >= 4 and object points can be in any configuration.

Flags of solvePnP

  • cv::SOLVEPNP_ITERATIVE Default solution. Iterative method is based on a Levenberg-Marquardt optimization. In this case the function finds such a pose that minimizes reprojection error, that is the sum of squared distances between the observed projections “imagePoints” and the projected (using cv::projectPoints ) “objectPoints”. Initial solution for non-planar(非平面) “objectPoints” needs at least 6 points and uses the DLT algorithm. Initial solution for planar “objectPoints” needs at least 4 points and uses pose from homography decomposition(单应性分解).

  • cv::SOLVEPNP_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang “Complete Solution Classification for the Perspective-Three-Point Problem”. In this case the function requires exactly 4 object and image points.=>same as use solveP3P with same flag

  • cv::SOLVEPNP_AP3P Method is based on the paper of T. Ke, S. Roumeliotis “An Efficient Algebraic Solution to the Perspective-Three-Point Problem” . In this case the function requires exactly 4 object and image points.=>same as use solveP3P with same flag

  • cv::SOLVEPNP_EPNP Method has been introduced by F. Moreno-Noguer, V. Lepetit and P. Fua in the paper “EPnP: Efficient Perspective-n-Point Camera Pose Estimation” .

  • cv::SOLVEPNP_DLS Broken implementation. Using this flag will fallback to EPnP.

  • cv::SOLVEPNP_UPNP Broken implementation. Using this flag will fallback to EPnP.

  • cv::SOLVEPNP_IPPE Method is based on the paper of T. Collins and A. Bartoli. “Infinitesimal Plane-Based Pose Estimation”. This method requires coplanar object points.

  • cv::SOLVEPNP_IPPE_SQUARE Method is based on the paper of Toby Collins and Adrien Bartoli. “Infinitesimal Plane-Based Pose Estimation”. This method is suitable for marker pose estimation. It requires 4 coplanar object points defined in the following order:
    point 0: [-squareLength / 2, squareLength / 2, 0]
    point 1: [ squareLength / 2, squareLength / 2, 0]
    point 2: [ squareLength / 2, -squareLength / 2, 0]
    point 3: [-squareLength / 2, -squareLength / 2, 0]

  • cv::SOLVEPNP_SQPNP Method is based on the paper “A Consistently Fast and Globally Optimal Solution to the Perspective-n-Point Problem” by G. Terzakis and M.Lourakis. It requires 3 or more points.

similar functions

  1. cv::solveP3P()
    Finds an object pose from 3 3D-2D point correspondences.

  2. cv::solvePnPGeneric()

Finds an object pose from 3D-2D point correspondences.

flags:

  • P3P methods (SOLVEPNP_P3P, SOLVEPNP_AP3P)
  • SOLVEPNP_IPPE
  • SOLVEPNP_IPPE_SQUARE
  1. solvePnPRansac()
    using the RANSAC scheme

  2. solvePnPRefineLM()
    Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.

  3. solvePnPRefineVVS()
    Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.

cv::SOLVEPNP_EPNP: Paper 008

论文内容:

propose a non-iterative solution to the PnP problem—the estimation of the pose of a cali- brated camera from n 3D-to-2D point correspondences— whose computational complexity grows linearly with n.

EPNP是求解PnP问题的非迭代方法。
优势是:

  1. 时间复杂度低,O(n),其他的是指数级,所以耗时短;
  2. 不依赖初始化;
  3. 鲁棒性高;
  4. 误差小。
  5. 用高斯牛顿方法可以进一步提高准确率,但计算耗时不会太大。

看论文里的实验数据,EPNP方法求得的rotation和translation存在随着匹配点数的增多,逐渐收敛趋于稳定的过程

图上看的话,噪声恒定的情况下,差不多10个点左右趋于收敛。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值