undistort function

Mat undistort(
  1. InputArray src,
  2. InputArray cameraMatrix,
  3. InputArray distCoeffs, {
  4. OutputArray? dst,
  5. InputArray? newCameraMatrix,
})

Implementation

Mat undistort(
  InputArray src,
  InputArray cameraMatrix,
  InputArray distCoeffs, {
  OutputArray? dst,
  InputArray? newCameraMatrix,
}) {
  dst ??= Mat.empty();
  newCameraMatrix ??= Mat.empty();
  cvRun(
    () => ccalib3d.cv_undistort(
      src.ref,
      dst!.ref,
      cameraMatrix.ref,
      distCoeffs.ref,
      newCameraMatrix!.ref,
      ffi.nullptr,
    ),
  );
  return dst;
}