Detect circles🔗

Detects circles in point sets. This tool can detect an arbitrary number of circles in boundary curves or other point sets. It can be used to accurately detect the location of circular objects, even when they overlap.

The input to this tool can come from any tool that finds point sets in images, such as DetectBoundariesTool, DrawEdgesTool or DetectCornersTool.


  • points: The (x, y) coordinates of detected points (a N-by-2 matrix). The points may be in arbitrary order.

  • minRadius: The minimum radius of a circle.

  • maxRadius: The maximum radius of a circle.

  • maxCircles: The maximum number of detections. If this value is exceeded, the tool retains the strongest detections.

  • radialTolerance: The relative amount of variation allowed in radial direction. For example, if this value is set to 0.05, then all points that are within 5% of the estimated circle radius will be regarded as part of the circle.

  • minConfidence: The minimum number of points required for a detection, relative to the circumference of the circle. For example, if this value is set to 0.5, then a detection is only accepted if there are at least 0.5 * 2 * pi * r points within*radialTolerance*.


  • center: The center points (x, y) of each detected circle as an N-by-2 matrix.

  • frame: The location and orientation of the upper left corner of a rectangle that encloses the detected circle. A 4*N-by-4 matrix.

  • size: The size of the rectangle that encloses a detected circle. An N-by-2 matrix. X- and Y-values are identical and equal to the diameter of the detected circle.

  • points: The points that made up a detection. The number of points for each detection is given by the blockSize output.

  • blockSize: An N-by-1 matrix that stores the number of points that made each detection.