Entropy of grayscale image
E = entropy(I)
E = entropy(I) returns
a scalar value representing the entropy of grayscale image
Entropy is a statistical measure of randomness that can be used to
characterize the texture of the input image. Entropy is defined as
p contains the normalized histogram counts returned from
imhist. By default,
entropy uses two bins for
logical arrays and 256 bins for
I can be a multidimensional image. If
more than two dimensions, the
treats it as a multidimensional grayscale image and not as an RGB
I can be
double and must be real, nonempty, and nonsparse.
entropy converts any class other than
the histogram count calculation so that the pixel values are discrete
and directly correspond to a bin value.
Read image into the workspace.
I = imread('circuit.tif');
Calculate the entropy.
J = entropy(I)
J = 6.9439
 Gonzalez, R.C., R.E. Woods, S.L. Eddins, Digital Image Processing Using MATLAB, New Jersey, Prentice Hall, 2003, Chapter 11.