Nodes/comfyui_cv/cv2.distanceTransform
ComfyUI Node

cv2.distanceTransform

Raw wrapper of cv2.distanceTransform(src, distanceType, maskSize, dstType?). 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.distanceTransform
  • src
  • nparray
distanceTypeDIST_L2
maskSize0
dstTypeCV_32F
Categoryimage/CV/low-level/cv2 D

Inputs (4)

NameTypeDefaultDescription
srcNPARRAY,IMAGE,MASK8-bit, single-channel (binary) source image. 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.
distanceTypeCOMBODIST_L2Type of distance, see #DistanceTypes
maskSizeINT0-2147483648–2147483647Size of the distance transform mask, see #DistanceTransformMasks. In case of the #DIST_L1 or #DIST_C distance type, the parameter is forced to 3 because a $3\times 3$ mask gives the same result as $5\times 5$ or any larger aperture.
dstTypeoptCOMBOCV_32FType of output image. It can be CV_8U or CV_32F. Type CV_8U can be used only for the first variant of the function and distanceType == #DIST_L1.

Outputs (1)

NameTypeDescription
nparrayNPARRAY