Home > freetb4matlab > image > graythresh.m

graythresh

PURPOSE ^

% Compute global image threshold using Otsu's method.

SYNOPSIS ^

function level = graythresh (I)

DESCRIPTION ^

% -*- 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003