ImageStat Module

优质
小牛编辑
140浏览
2023-12-01

The ImageStat module calculates global statistics for an image, or for a region of an image.

class PIL.ImageStat.Stat(image_or_list, mask=None)

Calculate statistics for the given image. If a mask is included, only the regions covered by that mask are included in the statistics. You can also pass in a previously calculated histogram.

参数:
  • image – A PIL image, or a precalculated histogram.
  • mask – An optional mask.
extrema

Min/max values for each band in the image.

count

Total number of pixels.

sum

Sum of all pixels.

sum2

Squared sum of all pixels.

pixel

Average pixel level.

median

Median pixel level.

rms

RMS (root-mean-square).

var

Variance.

stddev

Standard deviation.