Gray image thresholding using the Triangle Method

Computes a threshold the Triangle method.
Updated 12 Jul 2010

View License

The Triangle method is due to Zack (Zack GW, Rogers WE, Latt SA (1977), "Automatic measurement of sister chromatid exchange frequency", J. Histochem. Cytochem. 25 (7): 741–53.

A line is constructed between the maximum of the histogram at b on the gray level axis and the lowest (or highest depending on context) value a on the gray level axis where the histogram is significantly larger than 0. The distance L normal to the line and between the line and the histogram is computed for all values from a to b. The level where the distance between the histogram and the line is maximal is the threshold value (level). This technique is particularly effective when the object pixels produce a weak peak in the histogram.

Cite As

Bernard Panneton (2024). Gray image thresholding using the Triangle Method (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

A demo file was included.