findCirclesGrid1
import { findCirclesGrid1 } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Finds centers in the grid of circles.
Size patternsize(7,7); //number of centers
Mat gray = ...; //source image
vector<Point2f> centers; //this will be filled by the detected centers
bool patternfound = findCirclesGrid(gray, patternsize, centers);
drawChessboardCorners(img, patternsize, Mat(centers), patternfound);
Note: The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments.
findCirclesGrid1(image: Mat, patternSize: Size, centers: Mat, flags: number, blobDetector: Feature2D | null): boolean;3 available overloads
findCirclesGrid1(image: Mat, patternSize: Size, centers: Mat): boolean;findCirclesGrid1(image: Mat, patternSize: Size, centers: Mat, flags: number): boolean;findCirclesGrid1(image: Mat, patternSize: Size, centers: Mat, flags: number, blobDetector: Feature2D | null): boolean;imagegrid view of input circles; it must be an 8-bit grayscale or color image.
patternSizenumber of circles per row and column ( patternSize = Size(points_per_row, points_per_column) ).
centersOutput destination, filled by the native operation. output array of detected centers.
flagsvarious operation flags that can be one of the following values:
CALIB_CB_SYMMETRIC_GRIDuses symmetric pattern of circles.CALIB_CB_ASYMMETRIC_GRIDuses asymmetric pattern of circles.CALIB_CB_CLUSTERINGuses a special algorithm for grid detection. It is more robust to perspective distortions but much more sensitive to background clutter.
blobDetectorfeature detector that finds blobs like dark circles on light background. If
blobDetectoris NULL thenimagerepresents Point2f array of candidates.
The boolean result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.