skimage2.filters.threshold_triangle#
- skimage2.filters.threshold_triangle(image, nbins=256)[source]#
Return threshold value based on the triangle algorithm.
- Parameters:
- image(M, N[, …]) ndarray
Grayscale input image.
- nbinsint, optional
Number of bins used to calculate histogram. This value is ignored for integer arrays.
- Returns:
- thresholdfloat
Upper threshold value. All pixels with an intensity higher than this value are assumed to be foreground.
References
[1]Zack, G. W., Rogers, W. E. and Latt, S. A., 1977, Automatic Measurement of Sister Chromatid Exchange Frequency, Journal of Histochemistry and Cytochemistry 25 (7), pp. 741-753 DOI:10.1177/25.7.70454
[2]ImageJ AutoThresholder code, http://fiji.sc/wiki/index.php/Auto_Threshold
Examples
>>> from _skimage2.data import camera >>> image = camera() >>> thresh = threshold_triangle(image) >>> binary = image > thresh