findCirclesGrid function

(bool, Mat) findCirclesGrid(
  1. InputArray image,
  2. Size patternSize, {
  3. int flags = CALIB_CB_SYMMETRIC_GRID,
  4. OutputArray? centers,
})

Finds centers in the grid of circles.

bool cv::findCirclesGrid (InputArray image, Size patternSize, OutputArray centers, int flags=CALIB_CB_SYMMETRIC_GRID, const Ptr< FeatureDetector > &blobDetector=SimpleBlobDetector::create())

https://docs.opencv.org/4.11.0/d9/d0c/group__calib3d.html#ga7f02cd21c8352142890190227628fa80

Implementation

(bool, Mat) findCirclesGrid(
  InputArray image,
  Size patternSize, {
  int flags = CALIB_CB_SYMMETRIC_GRID,
  OutputArray? centers,
}) {
  centers ??= Mat.empty();
  final prval = calloc<ffi.Bool>();
  cvRun(
    () => ccalib3d.cv_findCirclesGrid(
      image.ref,
      patternSize.ref,
      centers!.ref,
      flags,
      prval,
      ffi.nullptr,
    ),
  );
  final rval = prval.value;
  calloc.free(prval);
  return (rval, centers);
}