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.
cv2.ximgproc.niBlackThreshold
- _src
- result
◄maxValue0.0000►
◄typeTHRESH_BINARY►
◄blockSize0►
◄k0.0000►
◄binarizationMethodBINARIZATION_NIBLACK►
◄r128.0000►
Categoryimage/CV/low-level/ximgproc
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| _src | COMFY_MATCHTYPE_V3 | Source 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. | |
| maxValue | FLOAT | 0.0000-1e+38–1e+38 | Non-zero value assigned to the pixels for which the condition is satisfied, used with the THRESH_BINARY and THRESH_BINARY_INV thresholding types. |
| type | COMBO | THRESH_BINARY | Thresholding type, see cv::ThresholdTypes. |
| blockSize | INT | 0-2147483648–2147483647 | Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on. |
| k | FLOAT | 0.0000-1e+38–1e+38 | The 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. |
| binarizationMethodopt | COMBO | BINARIZATION_NIBLACK | Binarization method to use. By default, Niblack's technique is used. Other techniques can be specified, see cv::ximgproc::LocalBinarizationMethods. |
| ropt | FLOAT | 128.0000-1e+38–1e+38 | The 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)
| Name | Type | Description |
|---|---|---|
| result | COMFY_MATCHTYPE_V3 | Echoes the '_src' input's format: an IMAGE link comes back as IMAGE, MASK as MASK, NPARRAY stays NPARRAY. |