undistortPoints function
        
Mat
undistortPoints(
    
- InputArray src,
- InputArray cameraMatrix,
- InputArray distCoeffs, {
- OutputArray? dst,
- InputArray? R,
- InputArray? P,
- (int, int, double) criteria = (TERM_COUNT + TERM_EPS, 30, 1e-4),
UndistortPoints transforms points to compensate for lens distortion
For further details, please see: https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga55c716492470bfe86b0ee9bf3a1f0f7e
Implementation
Mat undistortPoints(
  InputArray src,
  InputArray cameraMatrix,
  InputArray distCoeffs, {
  OutputArray? dst,
  InputArray? R,
  InputArray? P,
  (int type, int count, double eps) criteria = (TERM_COUNT + TERM_EPS, 30, 1e-4),
}) {
  R ??= Mat.empty();
  P ??= Mat.empty();
  dst ??= Mat.empty();
  final tc = criteria.cvd;
  cvRun(
    () => ccalib3d.cv_undistortPoints(
      src.ref,
      dst!.ref,
      cameraMatrix.ref,
      distCoeffs.ref,
      R!.ref,
      P!.ref,
      tc.ref,
      ffi.nullptr,
    ),
  );
  return dst;
}