otsu

Threshold selection

T = otsu(im) is an optimal threshold for binarizing an image with a bimodal intensity histogram. T is a scalar threshold that maximizes the variance between the classes of pixels below and above the thresold T.

Example

t = otsu(im);
idisp(im >= t);

Options

'levels', N Number of grey levels to use if image is float (default 256)
'valley', S Standard deviation for the Gaussian weighted valley emphasis option

Notes

Reference

A Threshold Selection Method from Gray-Level Histograms, N. otsu IEEE Trans. Systems, Man and Cybernetics Vol SMC-9(1), Jan 1979, pp 62-66

An improved method for image thresholding on the valley-emphasis method H-F Ng, D. Jargalsaikhan etal Signal and Info Proc. Assocn. Annual Summit and Conf (APSIPA) 2013 pp 1-4

See also

niblack, ithresh


Machine Vision Toolbox for MATLAB © 1990-2014 Peter Corke.