cv.threshold - MATLAB File Help
cv.threshold

Applies a fixed-level threshold to each array element

dst = cv.threshold(src, thresh)
dst = cv.threshold(src, thresh, 'OptionName',optionValue, ...)
[dst, thresh] = cv.threshold(src, 'auto', ...)

Input

Output

Options

The function applies fixed-level thresholding to a multiple-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image (cv.compare could be also used for this purpose) or for removing a noise, that is, filtering out pixels with too small or too large values. There are several types of thresholding supported by the function. They are determined by Type parameter.

When thresh is set 'Otsu' or 'Triangle', the function determines the optimal threshold value using the Otsu's or Triangle algorithm.

Note: Currently, the Otsu's and Triangle methods are implemented only for 8-bit single-channel images.

See also