Ask Your Question

Revision history [back]

Hi,

Circles that have big area are filtered out by default. Your image has rather high resolution and size of circles is bigger than the default threshold. You can change your code as this to get it working:

Mat image = imread("Untitled.png");
Size patternSize(4, 11);
vector<Point2f> centers;

SimpleBlobDetector::Params params;
params.maxArea = 10e4;
Ptr<FeatureDetector> blobDetector = new SimpleBlobDetector(params);

bool isFound = findCirclesGrid(image, patternSize, centers, CALIB_CB_ASYMMETRIC_GRID, blobDetector);

The main application of findCirclesGrid is camera calibration and so default parameters are tuned to eliminate false detections because it is much worse for calibration than several miss-detections. You can change parameters if they doen't satisfy you. For example, I use the following parameters with Kinect camera (VGA resolution):

SimpleBlobDetector::Params params;
params.minArea = 10;
params.minDistBetweenBlobs = 5;

Also I use the flag CALIB_CB_CLUSTERING. The pattern is detected in ~99% of my images with these parameters.