Skip to content

findCirclesGrid1

objdetectfunctionOpenCV 5.0.0
import { findCirclesGrid1 } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSimage, patternSize, centers, flags
FUNCTIONfindCirclesGrid1
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

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;
image

grid view of input circles; it must be an 8-bit grayscale or color image.

patternSize

number of circles per row and column ( patternSize = Size(points_per_row, points_per_column) ).

centers

Output destination, filled by the native operation. output array of detected centers.

flags

various operation flags that can be one of the following values:

  • CALIB_CB_SYMMETRIC_GRID uses symmetric pattern of circles.
  • CALIB_CB_ASYMMETRIC_GRID uses asymmetric pattern of circles.
  • CALIB_CB_CLUSTERING uses a special algorithm for grid detection. It is more robust to perspective distortions but much more sensitive to background clutter.
blobDetector

feature detector that finds blobs like dark circles on light background. If blobDetector is NULL then image represents Point2f array of candidates.

Returns

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.