M-File Help: niblack View code for niblack

niblack

Adaptive thresholding

T = niblack(im, k, w2) is the per-pixel (local) threshold to apply to image im. T has the same dimensions as im. The threshold at each pixel is a function of the mean and standard deviation computed over a WxW window, where W=2*w2+1.

[T,m,s] = niblack(im, k, w2) as above but returns the per-pixel mean m and standard deviation s.

Example

t = niblack(im, -0.2, 20);
idisp(im >= t);

Notes

Reference

An Introduction to Digital Image Processing, W. niblack, Prentice-Hall, 1986.

See also

otsu, ithresh


 

© 1990-2012 Peter Corke.