# cv::findCirclesGrid doesn't work

**URL:** <https://forum.opencv.org/t/cv-findcirclesgrid-doesnt-work/3041>\
**Category:** C++\
**Tags:** calib3d\
**Created:** [April 29, 2021, 1:48am UTC](https://forum.opencv.org/t/cv-findcirclesgrid-doesnt-work/3041 "2021-04-29T01:48:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![njit\_77](https://avatars.discourse-cdn.com/v4/letter/n/ecccb3/32.png) [@njit\_77](https://forum.opencv.org/u/njit_77)\
**Post date:** [April 29, 2021, 1:48am UTC](https://forum.opencv.org/t/cv-findcirclesgrid-doesnt-work/3041/1 "2021-04-29T01:48:20Z")

</div>

```
	cv::Mat image = cv::imread("0009.jpg", cv::IMREAD_GRAYSCALE);

	assert(image.data != nullptr);

	std::vector<cv::Point2f> pointBuf;
	cv::SimpleBlobDetector::Params params;
	params.filterByArea = true;
	params.minArea = 1e3;
	params.maxArea = 2 * 1e5;

	// Storage for blobs
	std::vector<cv::KeyPoint> keypoints;

	auto blobDetector = cv::SimpleBlobDetector::create(params);

	// Detect blobs
	blobDetector->detect(image, keypoints);
	cv::Mat im_with_keypoints;
	drawKeypoints(image, keypoints, im_with_keypoints, cv::Scalar(0, 0, 255), cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

	auto find = cv::findCirclesGrid(image, cv::Size(7, 7), pointBuf, cv::CALIB_CB_SYMMETRIC_GRID, blobDetector);
	if (find)
	{
		cv::cornerSubPix(image, pointBuf, cv::Size(7, 7), cv::Size(-1, -1), cv::TermCriteria(cv::TermCriteria::EPS + cv::TermCriteria::COUNT, 300, 0.001));
	}

```

here is my code, when i use blobDetector-\>detect(image, keypoints); this code work well, but when i use cv::findCirclesGrid(image, cv::Size(7, 7), pointBuf, cv::CALIB\_CB\_SYMMETRIC\_GRID, blobDetector); this code return failed. I use the same blobDetector, is someone know why?

 ![0009](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/a/a8f7cab3f371d176b23febd535f843dc1705bdc0.jpeg)

---

<div class="post-metadata">

**Author:** ![njit\_77](https://avatars.discourse-cdn.com/v4/letter/n/ecccb3/32.png) [@njit\_77](https://forum.opencv.org/u/njit_77)\
**Post date:** [April 29, 2021, 6:26am UTC](https://forum.opencv.org/t/cv-findcirclesgrid-doesnt-work/3041/2 "2021-04-29T06:26:41Z")

</div>

i use

> ```
> cv::findCirclesGrid(image, cv::Size(7, 7), pointBuf, cv::CALIB_CB_SYMMETRIC_GRID | cv::CALIB_CB_CLUSTERING, blobDetector)   
> 
> ```

this can work well
