ComfyUI Node
cv2.Canny (2/2)
Raw wrapper of cv2.Canny(dx, dy, threshold1, threshold2, L2gradient?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.
cv2.Canny (2/2)
- dx
- dy
- result
◄threshold10.0000►
◄threshold20.0000►
◄L2gradientfalse►
Categoryimage/CV/low-level/cv2 C
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| dx | COMFY_MATCHTYPE_V3 | 16-bit x derivative of input image (CV_16SC1 or CV_16SC3). 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. | |
| dy | NPARRAY,IMAGE,MASK | 16-bit y derivative of input image (same type as dx). 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. | |
| threshold1 | FLOAT | 0.0000-1e+38–1e+38 | first threshold for the hysteresis procedure. |
| threshold2 | FLOAT | 0.0000-1e+38–1e+38 | second threshold for the hysteresis procedure. |
| L2gradientopt | BOOLEAN | false | a 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)
| Name | Type | Description |
|---|---|---|
| result | COMFY_MATCHTYPE_V3 | Echoes the 'dx' input's format: an IMAGE link comes back as IMAGE, MASK as MASK, NPARRAY stays NPARRAY. |