# findCirclesGrid

**URL:** <https://forum.opencv.org/t/findcirclesgrid/5906>\
**Category:** C++\
**Tags:** calib3d, imgproc\
**Created:** [October 27, 2021, 10:30pm UTC](https://forum.opencv.org/t/findcirclesgrid/5906 "2021-10-27T22:30:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravik](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ravik/32/3599_2.png) [@ravik](https://forum.opencv.org/u/ravik)\
**Post date:** [October 27, 2021, 10:30pm UTC](https://forum.opencv.org/t/findcirclesgrid/5906/1 "2021-10-27T22:30:06Z")

</div>

Not able to detect the grid with the following function & parameters, however, i m able to detect the blobs with the SimpleBlobDetector. Below is the code. Any help highly appreciated

```auto

    Mat img_with_keypoints;
    SimpleBlobDetector::Params params;
    params.minThreshold = 8;
    params.maxThreshold = 250;

    // Filter by Area.
    params.filterByArea = true;
  
    params.minArea = 800;
    params.maxArea=25000;
    // Filter by Circularity
    params.filterByCircularity = true;

    params.minCircularity = 0.1;

    // Filter by Convexity
    params.filterByConvexity = true;
    params.minConvexity = 0.87;

    // Filter by Inertia
    params.filterByInertia = true;
    params.minInertiaRatio = 0.01;

    Ptr<SimpleBlobDetector> circleFinder = SimpleBlobDetector::create(params);
    
    img_calib = imread("CalibImage.jpg");
    std::vector<KeyPoint> keypoints;
    circleFinder->detect(img_calib,keypoints);
    std::cout <<"blobs detected: " <<keypoints.size()<<"\n";
    drawKeypoints(img_calib,keypoints,img_with_keypoints,Scalar(0,0,255),DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

Size patternSize = Size(27,19);

vector<Point2f> centers; //this will be filled by the detected centers;

CirclesGridFinderParameters _parameters;

_parameters.squareSize=76;

_parameters.convexHullFactor=1.1;

_parameters.gridType=CirclesGridFinderParameters::GridType::ASYMMETRIC_GRID;

_parameters.minDensity=20;

_parameters.minDistanceToAddKeypoint=70;

```

`cv::findCirclesGrid(img_calib,patternSize,centers,CALIB_CB_ASYMMETRIC_GRID,circleFinder,_parameters );`  
returns false.

Processing: 2021\_10\_27\_9\_53\_42\_Cam1\_Cali C1\_Left Bottom.bmp…

 ![CalibImage](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/4/492a3661a334559716b9192decf72ef3e8715c80.jpeg)

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [October 28, 2021, 6:26am UTC](https://forum.opencv.org/t/findcirclesgrid/5906/2 "2021-10-28T06:26:13Z")

</div>

try to fix your(sloppy) board first:

- more white border (‘quiet zone’)
- laminate it **absolutely flat**
