2013-10-14 08:57:07 +04:00
|
|
|
.. py:module:: PIL.ImageStat
|
|
|
|
.. py:currentmodule:: PIL.ImageStat
|
|
|
|
|
|
|
|
:py:mod:`ImageStat` Module
|
|
|
|
==========================
|
|
|
|
|
|
|
|
The :py:mod:`ImageStat` module calculates global statistics for an image, or
|
|
|
|
for a region of an image.
|
|
|
|
|
|
|
|
.. py: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.
|
|
|
|
|
|
|
|
:param image: A PIL image, or a precalculated histogram.
|
|
|
|
:param mask: An optional mask.
|
|
|
|
|
|
|
|
.. py:attribute:: extrema
|
|
|
|
|
|
|
|
Min/max values for each band in the image.
|
|
|
|
|
|
|
|
.. py:attribute:: count
|
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
Total number of pixels for each band in the image.
|
2013-10-14 08:57:07 +04:00
|
|
|
|
|
|
|
.. py:attribute:: sum
|
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
Sum of all pixels for each band in the image.
|
2013-10-14 08:57:07 +04:00
|
|
|
|
|
|
|
.. py:attribute:: sum2
|
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
Squared sum of all pixels for each band in the image.
|
2013-10-14 08:57:07 +04:00
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
.. py:attribute:: mean
|
2013-10-14 08:57:07 +04:00
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
Average (arithmetic mean) pixel level for each band in the image.
|
2013-10-14 08:57:07 +04:00
|
|
|
|
|
|
|
.. py:attribute:: median
|
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
Median pixel level for each band in the image.
|
2013-10-14 08:57:07 +04:00
|
|
|
|
|
|
|
.. py:attribute:: rms
|
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
RMS (root-mean-square) for each band in the image.
|
2013-10-14 08:57:07 +04:00
|
|
|
|
|
|
|
.. py:attribute:: var
|
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
Variance for each band in the image.
|
2013-10-14 08:57:07 +04:00
|
|
|
|
|
|
|
.. py:attribute:: stddev
|
|
|
|
|
2014-07-15 01:44:12 +04:00
|
|
|
Standard deviation for each band in the image.
|