cv.projectPoints - MATLAB File Help |
Projects 3D points to an image plane
imagePoints = cv.projectPoints(objectPoints, rvec, tvec, cameraMatrix)
[imagePoints, jacobian] = cv.projectPoints(...)
[...] = cv.projectPoints(..., 'OptionName', optionValue, ...)
{[x,y,z],...}
, where N
is the number of
points in the view.A = [fx 0 cx; 0 fy cy; 0 0 1]
.{[x,y], ...}
.(2N)x(3+3+2+2+numel(DistCoeffs))
jacobian
matrix of derivatives of image points with respect to components of the
rotation vector (3), translation vector (3), focal lengths (2),
coordinates of the principal point (2), and the distortion coefficients
(numel(DistCoeffs)
).[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 emptyfx/fy
) is fixed
and correspondingly adjusts the jacobian matrix. default 0.The function computes projections of 3D points to the image plane given intrinsic and extrinsic camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of image points coordinates (as functions of all the input parameters) with respect to the particular parameters, intrinsic and/or extrinsic. The Jacobians are used during the global optimization in cv.calibrateCamera, cv.solvePnP, and cv.stereoCalibrate. The function itself can also be used to compute a re-projection error given the current intrinsic and extrinsic parameters.
By setting rvec=tvec=[0,0,0]
or by setting cameraMatrix
to a 3x3
identity matrix, or by passing zero distortion coefficients, you can get
various useful partial cases of the function. This means that you can
compute the distorted coordinates for a sparse set of points or apply a
perspective transformation (and also compute the derivatives) in the
ideal zero-distortion setup.