Image.triangle#

Image.triangle(nbins: int = 256) Any[source]#

Triangle threshold selection.

Parameters:

nbins (int, optional) – number of bins for histogram computation, defaults to 256

Returns:

triangle threshold

Return type:

scalar

Compute an automatic threshold using the triangle algorithm from the image histogram. Works for greyscale integer and floating-point images.

Seealso:

threshold otsu