Nodes/comfyui_cv/cv2.Canny (1/2)
ComfyUI Node

cv2.Canny (1/2)

Raw wrapper of cv2.Canny(image, threshold1, threshold2, apertureSize?, L2gradient?). 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.Canny (1/2)
  • image
  • result
threshold10.0000
threshold20.0000
apertureSize3
L2gradientfalse
Categoryimage/CV/low-level/cv2 C

Inputs (5)

NameTypeDefaultDescription
imageCOMFY_MATCHTYPE_V38-bit input image. The image output(s) echo this input's format. 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.
threshold1FLOAT0.0000-1e+38–1e+38first threshold for the hysteresis procedure.
threshold2FLOAT0.0000-1e+38–1e+38second threshold for the hysteresis procedure.
apertureSizeoptINT3-2147483648–2147483647aperture size for the Sobel operator. Preset to the OpenCV default (3).
L2gradientoptBOOLEANfalsea flag, indicating whether a more accurate $L_2$ norm $=\sqrt{(dI/dx)^2 + (dI/dy)^2}$ should be used to calculate the image gradient magnitude ( L2gradient=true ), or whether the default $L_1$ norm $=|dI/dx|+|dI/dy|$ is enough ( L2gradient=false ). Preset to the OpenCV default (False).

Outputs (1)

NameTypeDescription
resultCOMFY_MATCHTYPE_V3Echoes the 'image' input's format: an IMAGE link comes back as IMAGE, MASK as MASK, NPARRAY stays NPARRAY.