This module calculates global statistics for an image, or a region of an image.
Stat(image [,mask]). Calculates statistics for the give image. If a mask is included, only the regions covered by that mask are included in the statistics.
Stat(list). Same, but calculates statistics for a previously calculated histogram.
The following attributes contain a sequence with one element for each layer in the image. All attributes are lazily evaluated; if you don't need a value, it won't be calculated.
extrema (attribute). Get min/max values for each band in the image.
count (attribute). Get total number of pixels.
sum (attribute). Get sum of all pixels.
sum2 (attribute). Squared sum of all pixels.
mean (attribute). Average pixel level.
median (attribute). Median pixel level.
rms (attribute). RMS (root-mean-square).
var (attribute). Variance.
stddev (attribute). Standard deviation.