MATLAB File Help: cv.solvePnPRansac | Index |
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme
[rvec, tvec, inliers] = cv.solvePnPRansac(objectPoints, imagePoints, cameraMatrix)
[...] = cv.solvePnPRansac(..., 'OptionName', optionValue, ...)
N
is the number of points, or cell
array of length N
of 3-element vectors can be also passed here
{[x,y,z], ...}
.N
is the number of points, or cell array of
length N
of 2-element vectors can be also passed here
{[x,y], ...}
.A = [fx 0 cx; 0 fy cy; 0 0 1]
.tvec
, brings points from the model coordinate system to the
camera coordinate system.objectPoints
and imagePoints
.[k1,k2,p1,p2,k3,k4,k5,k6,s1,s2,s3,s4,taux,tauy]
of 4, 5, 8, 12 or 14
elements. If the vector is empty, the zero distortion coefficients are
assumed. default empty.rvec
. Not set by default.tvec
. Not set by default.Method='Iterative'
. If true,
the function uses the provided rvec
and tvec
values as initial
approximations of the rotation and translation vectors, respectively,
and further optimizes them. default false.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.