Nodes/comfyui_cv/cv2.moments
ComfyUI Node

cv2.moments

Raw wrapper of cv2.moments(array, binaryImage?). 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.moments
  • array
  • moments
binaryImagefalse
Categoryimage/CV/low-level/cv2 M

Inputs (2)

NameTypeDefaultDescription
arrayNPARRAY,IMAGE,MASK - - - 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.
binaryImageoptBOOLEANfalse - - - Preset to the OpenCV default (False).

Outputs (1)

NameTypeDescription
momentsCV_MOMENTS- - - The 24 NAMED image moments (m00 ... nu03) - wire straight into cv2.HuMoments. cv2 reads them by name, so this stays a moments value rather than a list of numbers.