🟧 Hough Circle Detection

Function Description

This operator uses the Hough transform algorithm to identify regions that conform to circular features by analyzing edge information of the input grayscale image.

Usage Scenarios

  • Component detection: Identify circular holes, buttons, screw holes, etc. on products.

  • Defect detection: Find circular dents, bubbles, or flaws on product surfaces.

  • Object counting and positioning: Count and position circular objects like coins, pills, etc.

Input Output

Input

Input Image: Input single-channel grayscale image. For best results, circular edges in the image should be as clear as possible.

Output

Detection Results: Output a list of detection instances, each containing a polygon outlining the circular contour.

Center Points: A list containing the center point [x, y] coordinates of each detected circle.

Radius: A list containing the radius of each detected circle (in pixels).

Parameter Description

Detection Method

Parameter Description

Select the specific algorithm implementation for Hough circle detection.

Parameter Adjustment

  • Standard Hough Gradient Method: Uses gradient information (edge strength and direction) to detect straight lines in images, suitable for general straight line detection tasks.

  • High Precision Hough Gradient Method: An improved algorithm that is usually more accurate but may be slower in computation.

Minimum Circle Center Distance

Parameter Description

Used to set the minimum allowed distance between centers of two detected circles to avoid multiple overlapping detection results for the same circle.

Parameter Adjustment

  • Value too small: May detect multiple neighboring "false" circles near the same actual circle.

  • Value too large: If multiple circles are close together, some circles may be missed.

It is recommended to set this value slightly smaller than the actual center distance between the two closest circles expected to be detected.

Parameter Range

[0,800], Default value: 200

Edge Detection Threshold

Parameter Description

The high threshold parameter of the edge detector used by Hough circle detection, which determines what kind of edges are considered valid.

Parameter Adjustment

  • Increasing this value: Only very strong edges will be detected, helping to filter noise, but may also cause blurred circles to not be detected.

  • Decreasing this value: Edge detector will be more sensitive, able to find weaker edges, but may introduce more interference edges caused by noise.

Parameter Range

[0,1000], Default value: 200

Candidate Score Threshold

Parameter Description

Threshold for the circle center accumulator, i.e., the confidence score for determining whether a candidate circle is "real". Only when edge points forming a circle have "votes" for a circle center in parameter space exceeding this threshold is the circle considered to exist.

Parameter Adjustment

  • Increasing this value: Detection standard is stricter, only circles with very clear and complete contours will be detected, results are more reliable.

  • Decreasing this value: Detection standard is more lenient, can find more incomplete or blurred circles, but possibility of false positives also increases.

The smaller the radius of the target circle, the fewer pixel points on its circumference, so this value should be set smaller.

Parameter Range

[0,1000], Default value: 1

Minimum/Maximum Radius

Parameter Description

Set the radius range of circles to be detected.

Parameter Adjustment

By setting a reasonable radius range, detection speed and accuracy can be greatly improved, avoiding the algorithm wasting time on irrelevant sizes. Please estimate and set these two values based on the actual pixel size of target circles in the image.

Parameter Range

[1,800], Default value: 100/200, Unit: pixels