First time here? Check out the FAQ!

Ask Your Question
2

findCirclesGrid NOT Working

asked Oct 25 '12

ALLL gravatar image

updated Oct 31 '12

Dear all,

I'm having problems with the function findCirclesGrid(): it never finds the circles and it returns always false.

This is the simple piece of code:

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

bool found = findCirclesGrid( imageMat, patternsize, Mat(centers), CALIB_CB_ASYMMETRIC_GRID );

where Untitled.png is the following image http://robocraft.ru/files/opencv/acircles_pattern.png

[OpenCV2.3 + Visual Studio 2010 + 64bit]

Any suggestions?

Thanks,

ALLL

Preview: (hide)

Comments

The circlesgrid is a lot more sensitive to lighting differences than chessboard. We find that 25-35% of our images in a calibration sequence fail for no obvious reason.

mgb gravatar imagemgb (Oct 25 '12)edit

@mgb Perhaps you should change parameters of a blob detector (see my answer below). In my experiments detection of the circle grid is more stable than chessboard.

Ilya Lysenkov gravatar imageIlya Lysenkov (Oct 31 '12)edit

2 answers

Sort by » oldest newest most voted
4

answered Oct 31 '12

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.

Preview: (hide)

Comments

this code "Ptr<featuredetector> blobDetector = new SimpleBlobDetector(params);" I find have some problem . I use Openv3.3.0,must use creat() can complied succeed.like this "Ptr<featuredetector> blobDetector = SimpleBlobDetector::create(params);"

Winne King gravatar imageWinne King (Oct 19 '18)edit
0

answered Jan 15 '13

ALLL gravatar image

Thanks all for the replies.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Oct 25 '12

Seen: 15,799 times

Last updated: Jan 15 '13