% -*- texinfo -*- % @deftypefn {Function File} {@var{level}=} graythresh (@var{I}) % Compute global image threshold using Otsu's method. % % The output @var{level} is a global threshold (level) that can be used to convert % an intensity image to a binary image with @code{im2bw}. % @var{level} is a normalized intensity value that lies in the range [0, 1]. % % The function uses Otsu's method, which chooses the threshold to % minimize the intraclass variance of the black and white pixels. % % Color images are converted grayscale before @var{level} is computed. % @seealso{im2bw} % @end deftypefn