estimateNewCameraMatrixForUndistortRectify static method

Mat estimateNewCameraMatrixForUndistortRectify(
  1. InputArray K,
  2. InputArray D,
  3. (int, int) imageSize,
  4. InputArray R, {
  5. OutputArray? P,
  6. double balance = 0.0,
  7. (int, int) newSize = (0, 0),
  8. double fovScale = 1.0,
})

EstimateNewCameraMatrixForUndistortRectify estimates new camera matrix for undistortion or rectification.

For further details, please see: https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#ga384940fdf04c03e362e94b6eb9b673c9

Implementation

static Mat estimateNewCameraMatrixForUndistortRectify(
  InputArray K,
  InputArray D,
  (int, int) imageSize,
  InputArray R, {
  OutputArray? P,
  double balance = 0.0,
  (int, int) newSize = (0, 0),
  double fovScale = 1.0,
}) {
  P ??= Mat.empty();
  cvRun(
    () => ccalib3d.Fisheye_EstimateNewCameraMatrixForUndistortRectify(
      K.ref,
      D.ref,
      imageSize.cvd.ref,
      R.ref,
      P!.ref,
      balance,
      newSize.cvd.ref,
      fovScale,
    ),
  );
  return P;
}