


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