ImageStat Module

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.

本页

帮助信息

你可以从IRC频道获取实时帮助: irc://irc.freenode.net#pil。你也可以使用邮件列表: Image-SIG mailing list。当然还可以去 Stack Overflow

如果你发现了Bug,可以去 Github提交issues。