cv.solvePnPRansac - MATLAB File Help
cv.solvePnPRansac

Finds an object pose from 3D-2D point correspondences using the RANSAC scheme

[rvec, tvec, success, inliers] = cv.solvePnPRansac(objectPoints, imagePoints, cameraMatrix)
[...] = cv.solvePnPRansac(..., 'OptionName', optionValue, ...)

Input

Output

Options

The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera matrix and the distortion coefficients. This 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. The use of RANSAC makes the function resistant to outliers.

Note: The default method used to estimate the camera pose for the Minimal Sample Sets step is EPnP. Exceptions: if you choose P3P or AP3P, these methods will be used; if the number of input points is equal to 4, P3P is used.

The method used to estimate the camera pose using all the inliers is defined by the flags parameters unless it is equal to P3P or AP3P. In this case, the method EPnP will be used instead.

See also