Image Statistics

This library provides routines for measuring certain statistical
properties of an image buffer, such as the mean or variance. Some
histogramming functions are provided as well.

The routines in this library in general support image buffers with a
sample type of byte, short (signed and unsigned), int (signed or
unsigned), float and double, with any exceptions noted below. Images
are handled using the image
buffer protocol, which you should read about before using these
procedures.

Global Statistics

These functions compute statistics that have a scalar value per array
of data. Each returns a list of real numbers, one per channel of the
image buffer.

image-stats-max and image-stats-min return the
maximum or minimum value in each channel of the image.
image-stats-mean and image-stats-variance compute
the mean and variance of all the samples in each channel of the image.
image-stats-sum computes the sum of all the samples in each
channel of the image, and image-stats-energy calculates the
sum of the squares of all the samples.

Centroids

(image-stats-centroid low high image)

image-stats-centroid finds the centroid of a region defined
by a range of intensity values from low to high
inclusive. The centroid location is returned, or Null if
there are no pixels in the specified intensity range.