Nodes/comfyui_cv/cv2.adaptiveThreshold
ComfyUI Node

cv2.adaptiveThreshold

Raw wrapper of cv2.adaptiveThreshold(src, maxValue, adaptiveMethod, thresholdType, blockSize, C). 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.adaptiveThreshold
  • src
  • result
maxValue0.0000
adaptiveMethodADAPTIVE_THRESH_GAUSSIAN_C
thresholdTypeTHRESH_BINARY
blockSize0
C0.0000
Categoryimage/CV/low-level/cv2 A

Inputs (6)

NameTypeDefaultDescription
srcCOMFY_MATCHTYPE_V3Source 8-bit single-channel 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.
maxValueFLOAT0.0000-1e+38–1e+38Non-zero value assigned to the pixels for which the condition is satisfied
adaptiveMethodCOMBOADAPTIVE_THRESH_GAUSSIAN_CAdaptive thresholding algorithm to use, see #AdaptiveThresholdTypes. The #BORDER_REPLICATE | #BORDER_ISOLATED is used to process boundaries.
thresholdTypeCOMBOTHRESH_BINARYThresholding type that must be either #THRESH_BINARY or #THRESH_BINARY_INV, see #ThresholdTypes.
blockSizeINT0-2147483648–2147483647Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on.
CFLOAT0.0000-1e+38–1e+38Constant subtracted from the mean or weighted mean (see the details below). Normally, it is positive but may be zero or negative as well.

Outputs (1)

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