findCirclesGrid

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


    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…

try to fix your(sloppy) board first:

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