Detect and Measure Circle

Function Description

This step can detect and measure circles in the input image, supporting two detection methods: fitting circle and inscribed circle.

Use Cases

Fitting Circle Application Scenarios

  • Flange hole/bearing center positioning: Precisely identify the center coordinates of circular holes, used for assembly guidance

  • Washer/seal ring dimension inspection: Measure the actual diameter of circular workpieces to determine if they exceed tolerance ranges

  • Lens curvature center positioning: Detect the geometric center of optical elements for precise alignment

Inscribed Circle Application Scenarios

  • Robot suction cup grasp point positioning: For “L”-shaped, “U”-shaped, or irregular polygon objects, calculate the maximum inscribed circle as the suction cup placement point to ensure the suction cup completely covers the object surface and improve grasping stability

  • Bottle mouth/hole diameter detection: Measure the minimum inner diameter of through holes for quality go/no-go gauge determination

  • Connected character segmentation assistance: Use distance transform peak points to determine the character body center, assisting OCR character segmentation

  • Adhesive area defect detection: Measure the narrowest width of the adhesive area to determine if the adhesive is uniform

Inputs

  • Mask (Required): Image for circle detection.

  • Poses 2D (Required): Theoretical circle center position (search center point), coordinate system origin is the top-left corner of the image.

  • Expected Radius (Required): Theoretical radius value (pixels), used to define the search range during fitting circle detection (not the actual output radius).

  • Rectangle ROI Radius (Required): Theoretical radius value (pixels), used to define the search range during inscribed circle detection (not the actual output radius).

Outputs

  • Color Map: Original image with visualization information. (Red: initial circle, Green: detected circle, Blue: circle index)

  • Circles: Center coordinates and actual radius of the detected circle.

  • Radius: Actual radius list (pixels).

  • Circularity: Circularity score list (0~1, ≥0.85 is reliable detection).

Parameters

Circle Type

Specify the type of circle to detect:

  • Fit Circle: Fits the best circle based on edge points, suitable for complete or nearly complete circular features.

  • Inner Circle: Calculates the maximum inscribed circle within a region, suitable for determining safe grasp points for irregular regions or minimum passage diameter measurement.

Fit Circle

  • Inner Radius Tolerance

    Maximum allowable inward shrinkage of the circle.

    Search Inner Diameter = Expected Radius - Inner Radius Tolerance

    Unit: pixels. Recommended setting range: 5~15 (precision scenes)

  • Outer Radius Tolerance

    Maximum allowable outward expansion of the circle.

    Search Outer Diameter = Expected Radius + Outer Radius Tolerance

    Unit: pixels. Recommended setting range: 5~15 (precision scenes)

  • Center Tolerance

    Maximum distance the circle center can deviate from the initial pose, used to define the circle search region radius.

    Unit: pixels. Recommended setting range: 10~30 (general)

Inner Circle

  • Polarity

    Select the type of inscribed circle to detect based on actual situation:

    • Find inner circle of bright regions

    • Find inner circle of holes