ComfyUI Node
cv2.connectedComponentsWithStats
Raw wrapper of cv2.connectedComponentsWithStats(image, connectivity?, ltype?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.
cv2.connectedComponentsWithStats
- image
- retval
- labels
- stats
- centroids
◄connectivity8►
◄ltypeCV_32S►
Categoryimage/CV/low-level/cv2 C
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | NPARRAY,IMAGE,MASK | the 8-bit single-channel image to be labeled Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| connectivityopt | INT | 8-2147483648–2147483647 | 8 or 4 for 8-way or 4-way connectivity respectively Preset to the OpenCV default (8). |
| ltypeopt | COMBO | CV_32S | output image label type. Currently CV_32S and CV_16U are supported. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| retval | INT | — |
| labels | NPARRAY | — |
| stats | NPARRAY | — |
| centroids | NPARRAY | — |