discontinuedPackage opencv_core has been discontinued and replaced by dartcv4.

calibrateCamera function

(double, Mat, Mat, Mat, Mat) calibrateCamera(
  1. Contours3f objectPoints,
  2. Contours2f imagePoints,
  3. (int, int) imageSize,
  4. InputOutputArray cameraMatrix,
  5. InputOutputArray distCoeffs, {
  6. Mat? rvecs,
  7. Mat? tvecs,
  8. int flags = 0,
  9. (int, int, double) criteria = (TERM_COUNT + TERM_EPS, 30, 1e-4),
})

CalibrateCamera finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.

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

Implementation

(double rmsErr, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs) calibrateCamera(
  Contours3f objectPoints,
  Contours2f imagePoints,
  (int, int) imageSize,
  InputOutputArray cameraMatrix,
  InputOutputArray distCoeffs, {
  Mat? rvecs,
  Mat? tvecs,
  int flags = 0,
  (int type, int count, double eps) criteria = (TERM_COUNT + TERM_EPS, 30, 1e-4),
}) {
  rvecs ??= Mat.empty();
  tvecs ??= Mat.empty();
  final cRmsErr = calloc<ffi.Double>();

  cvRun(
    () => ccalib3d.cv_calibrateCamera(
      objectPoints.ref,
      imagePoints.ref,
      imageSize.cvd.ref,
      cameraMatrix.ref,
      distCoeffs.ref,
      rvecs!.ref,
      tvecs!.ref,
      flags,
      criteria.cvd.ref,
      cRmsErr,
      ffi.nullptr,
    ),
  );
  final rmsErr = cRmsErr.value;
  calloc.free(cRmsErr);
  return (rmsErr, cameraMatrix, distCoeffs, rvecs, tvecs);
}