ThresholdType

Thresholding types are used in image thresholding functions.

class sasviya.cv.cvenums.ThresholdType
THRESH_BINARY

Applies a fixed-level threshold to each pixel. If the pixel value is greater than the threshold, it is set to the maximum value; otherwise, it is set to 0.

THRESH_BINARY_INV

Applies a fixed-level threshold to each pixel. If the pixel value is greater than the threshold, it is set to 0; otherwise, it is set to the maximum value.

THRESH_OTSU

Automatically calculates the optimal threshold value by using Otsu’s method and applies a binary threshold.

THRESH_TOZERO

Applies a fixed-level threshold to each pixel. If the pixel value is greater than the threshold, it remains unchanged; otherwise, it is set to 0.

THRESH_TOZERO_INV

Applies a fixed-level threshold to each pixel. If the pixel value is greater than the threshold, it is set to 0; otherwise, it remains unchanged.

THRESH_TRIANGLE

Automatically calculates the optimal threshold value by using the triangle algorithm and applies a binary threshold.

THRESH_TRUNC

Applies a fixed-level threshold to each pixel. If the pixel value is greater than the threshold, it is set to the threshold value; otherwise, it remains unchanged.

Last updated: August 12, 2026