solvePnPGeneric function
(int, VecMat, VecMat, Mat)
solvePnPGeneric(
- InputArray objectPoints,
- InputArray imagePoints,
- InputArray cameraMatrix,
- InputArray distCoeffs, {
- VecMat? rvecs,
- VecMat? tvecs,
- bool useExtrinsicGuess = false,
- int flags = SOLVEPNP_ITERATIVE,
- InputArray? rvec,
- InputArray? tvec,
- OutputArray? reprojectionError,
Finds an object pose from 3D-2D point correspondences.
https://docs.opencv.org/4.11.0/d9/d0c/group__calib3d.html#ga624af8a6641b9bdb487f63f694e8bb90
Implementation
(int rval, VecMat rvecs, VecMat tvecs, Mat reprojectionError) solvePnPGeneric(
InputArray objectPoints,
InputArray imagePoints,
InputArray cameraMatrix,
InputArray distCoeffs, {
VecMat? rvecs,
VecMat? tvecs,
bool useExtrinsicGuess = false,
int flags = SOLVEPNP_ITERATIVE,
InputArray? rvec,
InputArray? tvec,
OutputArray? reprojectionError,
}) {
rvecs ??= VecMat();
tvecs ??= VecMat();
rvec ??= Mat.empty();
tvec ??= Mat.empty();
reprojectionError ??= Mat.empty();
final prval = calloc<ffi.Int>();
cvRun(
() => ccalib3d.cv_solvePnPGeneric(
objectPoints.ref,
imagePoints.ref,
cameraMatrix.ref,
distCoeffs.ref,
rvecs!.ptr,
tvecs!.ptr,
useExtrinsicGuess,
flags,
rvec!.ref,
tvec!.ref,
reprojectionError!.ref,
prval,
ffi.nullptr,
),
);
final rval = prval.value;
calloc.free(prval);
return (rval, rvecs, tvecs, reprojectionError);
}