MATLAB File Help: cv.findCirclesGrid Index
cv.findCirclesGrid

Finds the centers in the grid of circles

centers = cv.findCirclesGrid(im, patternSize)
[centers,patternFound] = cv.findCirclesGrid(im, patternSize)
[...] = cv.findCirclesGrid(..., 'OptionName', optionValue, ...)

Input

Output

Options

The function attempts to determine whether the input image contains a grid of circles. If it is, the function locates centers of the circles. The function returns true if all of the centers have been found and they have been placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns false.

Example

Sample usage of detecting and drawing the centers of circles:

patternSize = [7,7];   % number of centers
gray = imread('...');  % source 8-bit image
[centers,patternfound] = cv.findCirclesGrid(gray, patternSize);
img = cv.drawChessboardCorners(img, patternSize, cat(1,centers{:}), ...
    'PatternWasFound',patternfound);
imshow(img)

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.

See also