Implemented new algorithm for asymmetric circles pattern detection. Use flag CALIB_CB_CLUSTERING.
This commit is contained in:
@@ -1937,7 +1937,13 @@ void drawChessboardCorners( Mat& image, Size patternSize,
|
||||
bool findCirclesGrid( const Mat& image, Size patternSize,
|
||||
vector<Point2f>& centers, int flags )
|
||||
{
|
||||
Ptr<SimpleBlobDetector> detector = new SimpleBlobDetector();
|
||||
SimpleBlobDetector::Params params;
|
||||
if(flags & CALIB_CB_WHITE_CIRCLES)
|
||||
{
|
||||
params.filterByColor = true;
|
||||
params.blobColor = 255;
|
||||
}
|
||||
Ptr<SimpleBlobDetector> detector = new SimpleBlobDetector(params);
|
||||
//Ptr<FeatureDetector> detector = new MserFeatureDetector();
|
||||
vector<KeyPoint> keypoints;
|
||||
detector->detect(image, keypoints);
|
||||
@@ -1947,6 +1953,13 @@ bool findCirclesGrid( const Mat& image, Size patternSize,
|
||||
points.push_back (keypoints[i].pt);
|
||||
}
|
||||
|
||||
if((flags & CALIB_CB_CLUSTERING) && (flags & CALIB_CB_ASYMMETRIC_GRID))
|
||||
{
|
||||
CirclesGridClusterFinder circlesGridClusterFinder;
|
||||
circlesGridClusterFinder.findGrid(points, patternSize, centers);
|
||||
return !centers.empty();
|
||||
}
|
||||
|
||||
CirclesGridFinderParameters parameters;
|
||||
parameters.vertexPenalty = -0.6f;
|
||||
parameters.vertexGain = 1;
|
||||
|
Reference in New Issue
Block a user