undistortImage static method

Mat undistortImage(
  1. InputArray distorted,
  2. InputArray K,
  3. InputArray D, {
  4. OutputArray? undistorted,
  5. InputArray? knew,
  6. (int, int) newSize = (0, 0),
})

FisheyeUndistortImage transforms an image to compensate for fisheye lens distortion https://docs.opencv.org/3.4/db/d58/group__calib3d__fisheye.html#ga167df4b00a6fd55287ba829fbf9913b9

Implementation

static Mat undistortImage(
  InputArray distorted,
  InputArray K,
  InputArray D, {
  OutputArray? undistorted,
  InputArray? knew,
  (int, int) newSize = (0, 0),
}) {
  knew ??= Mat.empty();
  final p1 = undistorted?.ptr ?? calloc<cvg.Mat>();
  cvRun(
    () => cffi.Fisheye_UndistortImageWithParams(
      distorted.ref,
      p1,
      K.ref,
      D.ref,
      knew!.ref,
      newSize.cvd.ref,
    ),
  );
  return undistorted ?? Mat.fromPointer(p1);
}