getOptimalNewCameraMatrixAsync function

Future<(Mat, Rect)> getOptimalNewCameraMatrixAsync(
  1. InputArray cameraMatrix,
  2. InputArray distCoeffs,
  3. (int, int) imageSize,
  4. double alpha, {
  5. (int, int) newImgSize = (0, 0),
  6. bool centerPrincipalPoint = false,
})

GetOptimalNewCameraMatrixWithParams computes and returns the optimal new camera matrix based on the free scaling parameter.

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

Implementation

Future<(Mat rval, Rect validPixROI)> getOptimalNewCameraMatrixAsync(
  InputArray cameraMatrix,
  InputArray distCoeffs,
  (int, int) imageSize,
  double alpha, {
  (int, int) newImgSize = (0, 0),
  bool centerPrincipalPoint = false,
}) async =>
    cvRunAsync2(
      (callback) => cffi.getOptimalNewCameraMatrix_Async(
        cameraMatrix.ref,
        distCoeffs.ref,
        imageSize.cvd.ref,
        alpha,
        newImgSize.cvd.ref,
        centerPrincipalPoint,
        callback,
      ),
      (c, p, p1) => c.complete((Mat.fromPointer(p.cast()), Rect.fromPointer(p1.cast()))),
    );