Method ProjectPoints
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
ProjectPoints(InputArray, InputArray, InputArray, InputArray, InputArray, OutputArray, OutputArray, double)
projects points from the model coordinate space to the image coordinates. Also computes derivatives of the image coordinates w.r.t the intrinsic and extrinsic camera parameters
public static void ProjectPoints(InputArray objectPoints, InputArray rvec, InputArray tvec, InputArray cameraMatrix, InputArray distCoeffs, OutputArray imagePoints, OutputArray jacobian = default, double aspectRatio = 0)
Parameters
objectPointsInputArrayArray of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points in the view.
rvecInputArrayRotation vector (3x1).
tvecInputArrayTranslation vector (3x1).
cameraMatrixInputArrayCamera matrix (3x3)
distCoeffsInputArrayInput vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is null, the zero distortion coefficients are assumed.
imagePointsOutputArrayOutput array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel
jacobianOutputArrayOptional output 2Nx(10 + numDistCoeffs) jacobian matrix of derivatives of image points with respect to components of the rotation vector, translation vector, focal lengths, coordinates of the principal point and the distortion coefficients. In the old interface different components of the jacobian are returned via different output parameters.
aspectRatiodoubleOptional “fixed aspect ratio” parameter. If the parameter is not 0, the function assumes that the aspect ratio (fx/fy) is fixed and correspondingly adjusts the jacobian matrix.
ProjectPoints(IEnumerable<Point3f>, double[], double[], double[,], double[], out Point2f[], out double[,], double)
projects points from the model coordinate space to the image coordinates. Also computes derivatives of the image coordinates w.r.t the intrinsic and extrinsic camera parameters
[SuppressMessage("Maintainability", "CA1508: Avoid dead conditional code")]
public static void ProjectPoints(IEnumerable<Point3f> objectPoints, double[] rvec, double[] tvec, double[,] cameraMatrix, double[] distCoeffs, out Point2f[] imagePoints, out double[,] jacobian, double aspectRatio = 0)
Parameters
objectPointsIEnumerable<Point3f>Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points in the view.
rvecdouble[]Rotation vector (3x1).
tvecdouble[]Translation vector (3x1).
cameraMatrixdouble[,]Camera matrix (3x3)
distCoeffsdouble[]Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is null, the zero distortion coefficients are assumed.
imagePointsPoint2f[]Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel
jacobiandouble[,]Optional output 2Nx(10 + numDistCoeffs) jacobian matrix of derivatives of image points with respect to components of the rotation vector, translation vector, focal lengths, coordinates of the principal point and the distortion coefficients. In the old interface different components of the jacobian are returned via different output parameters.
aspectRatiodoubleOptional “fixed aspect ratio” parameter. If the parameter is not 0, the function assumes that the aspect ratio (fx/fy) is fixed and correspondingly adjusts the jacobian matrix.