solvePnPRansacAsync static method
Future<(bool, Mat, Mat, Mat)>
solvePnPRansacAsync(
- InputArray objectPoints,
- InputArray imagePoints,
- InputArray cameraMatrix,
- InputArray distCoeffs, {
- OutputArray? rvec,
- OutputArray? tvec,
- OutputArray? inliers,
- double reprojectionError = 8.0,
- int iterationsCount = 100,
- double confidence = 0.99,
- bool useExtrinsicGuess = false,
- int flags = SOLVEPNP_ITERATIVE,
- TermCriteria? criteria,
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
https://docs.opencv.org/4.x/db/d58/group__calib3d__fisheye.html#gabc1c7a253a8cf2a09f948f8426967a56
Implementation
static Future<(bool rval, Mat rvec, Mat tvec, Mat inliers)> solvePnPRansacAsync(
InputArray objectPoints,
InputArray imagePoints,
InputArray cameraMatrix,
InputArray distCoeffs, {
OutputArray? rvec,
OutputArray? tvec,
OutputArray? inliers,
double reprojectionError = 8.0,
int iterationsCount = 100,
double confidence = 0.99,
bool useExtrinsicGuess = false,
int flags = SOLVEPNP_ITERATIVE,
TermCriteria? criteria,
}) async {
rvec ??= Mat.empty();
tvec ??= Mat.empty();
inliers ??= Mat.empty();
criteria ??= TermCriteria(TERM_MAX_ITER + TERM_EPS, 10, 1e-8);
final prval = calloc<ffi.Bool>();
return cvRunAsync0(
(callback) => ccalib3d.cv_fisheye_solvePnPRansac(
objectPoints.ref,
imagePoints.ref,
cameraMatrix.ref,
distCoeffs.ref,
rvec!.ref,
tvec!.ref,
useExtrinsicGuess,
iterationsCount,
reprojectionError,
confidence,
inliers!.ref,
flags,
criteria!.ref,
prval,
callback,
),
(c) {
final rval = prval.value;
calloc.free(prval);
return c.complete((rval, rvec!, tvec!, inliers!));
},
);
}