recoverPose function

(int, Mat, Mat) recoverPose(
  1. InputArray E,
  2. InputArray points1,
  3. InputArray points2, {
  4. OutputArray? R,
  5. OutputArray? t,
  6. double focal = 1,
  7. Point2d? pp,
  8. InputOutputArray? mask,
})

Recovers the relative camera rotation and the translation from an estimated essential matrix and the corresponding points in two images, using chirality check. Returns the number of inliers that pass the check.

int cv::recoverPose (InputArray E, InputArray points1, InputArray points2, OutputArray R, OutputArray t, double focal=1.0, Point2d pp=Point2d(0, 0), InputOutputArray mask=noArray())

https://docs.opencv.org/4.11.0/d9/d0c/group__calib3d.html#ga40919d0c7eaf77b0df67dd76d5d24fa1

Implementation

(int rval, Mat R, Mat t) recoverPose(
  InputArray E,
  InputArray points1,
  InputArray points2, {
  OutputArray? R,
  OutputArray? t,
  double focal = 1,
  Point2d? pp,
  InputOutputArray? mask,
}) {
  R ??= Mat.empty();
  t ??= Mat.empty();
  mask ??= Mat.empty();
  pp ??= Point2d(0, 0);
  final prval = calloc<ffi.Int>();
  cvRun(
    () => ccalib3d.cv_recoverPose_1(
      E.ref,
      points1.ref,
      points2.ref,
      R!.ref,
      t!.ref,
      focal,
      pp!.ref,
      mask!.ref,
      prval,
      ffi.nullptr,
    ),
  );
  final rval = prval.value;
  calloc.free(prval);
  return (rval, R, t);
}