Home > freetb4matlab > image > entropy.m

entropy

PURPOSE ^

% Computes the entropy of an image.

SYNOPSIS ^

function retval = entropy (I, nbins = 0)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {@var{E} =} entropy (@var{im})
% @deftypefnx{Function File} {@var{E} =} entropy (@var{im}, @var{nbins})
% Computes the entropy of an image.
%
% The entropy of the elements of the image @var{im} is computed as
%
% @example
% @var{E} = -sum (@var{P} .* log2 (@var{P})
% @end example
%
% where @var{P} is the distribution of the elements of @var{im}. The distribution
% is approximated using a histogram with @var{nbins} cells. If @var{im} is
% @code{logical} then two cells are used by default. For other classes 256 cells
% are used by default.
%
% When the entropy is computed, zero-valued cells of the histogram are ignored.
%
% @seealso{entropyfilt}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003