Nodes/comfyui_cv/cv2.ximgproc.niBlackThreshold
ComfyUI Node

cv2.ximgproc.niBlackThreshold

Raw wrapper of cv2.ximgproc.niBlackThreshold(_src, maxValue, type, blockSize, k, binarizationMethod?, r?). Parameters marked '?' are optional; blank means OpenCV default. From the opencv-contrib 'ximgproc' module. See the OpenCV documentation for details.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
cv2.ximgproc.niBlackThreshold
  • _src
  • result
maxValue0.0000
typeTHRESH_BINARY
blockSize0
k0.0000
binarizationMethodBINARIZATION_NIBLACK
r128.0000
Categoryimage/CV/low-level/ximgproc

Inputs (7)

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, used with the THRESH_BINARY and THRESH_BINARY_INV thresholding types.
typeCOMBOTHRESH_BINARYThresholding type, see cv::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.
kFLOAT0.0000-1e+38–1e+38The user-adjustable parameter used by Niblack and inspired techniques. For Niblack, this is normally a value between 0 and 1 that is multiplied with the standard deviation and subtracted from the mean.
binarizationMethodoptCOMBOBINARIZATION_NIBLACKBinarization method to use. By default, Niblack's technique is used. Other techniques can be specified, see cv::ximgproc::LocalBinarizationMethods.
roptFLOAT128.0000-1e+38–1e+38The user-adjustable parameter used by Sauvola's technique. This is the dynamic range of standard deviation. Preset to the OpenCV default (128.0).

Outputs (1)

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