Nodes/comfyui_cv/cv2.connectedComponentsWithStats
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.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
cv2.connectedComponentsWithStats
  • image
  • retval
  • labels
  • stats
  • centroids
connectivity8
ltypeCV_32S
Categoryimage/CV/low-level/cv2 C

Inputs (3)

NameTypeDefaultDescription
imageNPARRAY,IMAGE,MASKthe 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.
connectivityoptINT8-2147483648–21474836478 or 4 for 8-way or 4-way connectivity respectively Preset to the OpenCV default (8).
ltypeoptCOMBOCV_32Soutput image label type. Currently CV_32S and CV_16U are supported.

Outputs (4)

NameTypeDescription
retvalINT
labelsNPARRAY
statsNPARRAY
centroidsNPARRAY