discontinuedPackage opencv_core has been discontinued and replaced by dartcv4.

initUndistortRectifyMap function

(Mat, Mat) initUndistortRectifyMap(
  1. InputArray cameraMatrix,
  2. InputArray distCoeffs,
  3. InputArray R,
  4. InputArray newCameraMatrix,
  5. (int, int) size,
  6. int m1type, {
  7. OutputArray? map1,
  8. OutputArray? map2,
})

InitUndistortRectifyMap computes the joint undistortion and rectification transformation and represents the result in the form of maps for remap

For further details, please see: https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga7dfb72c9cf9780a347fbe3d1c47e5d5a

Implementation

(Mat map1, Mat map2) initUndistortRectifyMap(
  InputArray cameraMatrix,
  InputArray distCoeffs,
  InputArray R,
  InputArray newCameraMatrix,
  (int, int) size,
  int m1type, {
  OutputArray? map1,
  OutputArray? map2,
}) {
  map1 ??= Mat.empty();
  map2 ??= Mat.empty();
  cvRun(
    () => ccalib3d.cv_initUndistortRectifyMap(
      cameraMatrix.ref,
      distCoeffs.ref,
      R.ref,
      newCameraMatrix.ref,
      size.cvd.ref,
      m1type,
      map1!.ref,
      map2!.ref,
      ffi.nullptr,
    ),
  );
  return (map1, map2);
}