bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / filters / thresholding / threshold_triangle
function
skimage.filters.thresholding:threshold_triangle
source: /dev/scikit-image/src/skimage/filters/thresholding.py :914
Signature
def threshold_triangle ( image , nbins = 256 ) Summary
Return threshold value based on the triangle algorithm.
Parameters
image: (M, N[, ...]) ndarrayGrayscale input image.
nbins: int, optionalNumber of bins used to calculate histogram. This value is ignored for integer arrays.
Returns
threshold: floatUpper threshold value. All pixels with an intensity higher than this value are assumed to be foreground.
Examples
from skimage.data import camera image = camera() thresh = threshold_triangle(image) binary = image > thresh✓
Aliases
-
skimage.filters.threshold_triangle