ComfyUI Node
CV Enclosing Circle
Smallest circle around a contour (cv2.minEnclosingCircle) - e.g. a clock dial, a ball, a coin. 'longest contour' (the default) selects by perimeter, which stays robust when the shape's outline breaks into an open arc: an open curve traces out and back, so its AREA is near zero and area-based selection would pick some small closed blob instead (this happened with a clock rim that lost a few edge pixels to decoder differences). 'largest contour' selects by area; 'all contours merged' circles every contour point at once. Failure-tolerant: with no contours it returns found=false and zeros instead of stopping the workflow (downstream nodes treat radius 0 as not-found).
CV Enclosing Circle
- contours
- center_x
- center_y
- radius
- found
- center
◄selectlongest contour (perimeter)►
Categoryimage/CV/contours
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| contours | CV_CONTOURS | From 'CV Find Contours'. | |
| select | COMBO | longest contour (perimeter) | Which contour to circle. Perimeter is robust to broken outlines; merged spans everything (use it when the whole edge map belongs to one object). |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| center_x | FLOAT | — |
| center_y | FLOAT | — |
| radius | FLOAT | — |
| found | BOOLEAN | — |
| center | CV_TUPLE | The centre as ONE composite (x, y) value - wire it into a cv2 node's centre/point input in one link instead of two. Subpixel: a point2i input rounds it. |