solvePnPAsync function

Future<(bool, Mat, Mat)> solvePnPAsync(
  1. InputArray objectPoints,
  2. InputArray imagePoints,
  3. InputArray cameraMatrix,
  4. InputArray distCoeffs, {
  5. OutputArray? rvec,
  6. OutputArray? tvec,
  7. bool useExtrinsicGuess = false,
  8. int flags = SOLVEPNP_ITERATIVE,
})

Implementation

Future<(bool rval, Mat rvec, Mat tvec)> solvePnPAsync(
  InputArray objectPoints,
  InputArray imagePoints,
  InputArray cameraMatrix,
  InputArray distCoeffs, {
  OutputArray? rvec,
  OutputArray? tvec,
  bool useExtrinsicGuess = false,
  int flags = SOLVEPNP_ITERATIVE,
}) async {
  rvec ??= Mat.empty();
  tvec ??= Mat.empty();
  final prval = calloc<ffi.Bool>();
  return cvRunAsync0(
    (callback) => ccalib3d.cv_solvePnP(
      objectPoints.ref,
      imagePoints.ref,
      cameraMatrix.ref,
      distCoeffs.ref,
      rvec!.ref,
      tvec!.ref,
      useExtrinsicGuess,
      flags,
      prval,
      callback,
    ),
    (c) {
      final rval = prval.value;
      calloc.free(prval);
      return c.complete((rval, rvec!, tvec!));
    },
  );
}