mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Fully document PIL.ImageStat
This commit is contained in:
parent
f284c194ca
commit
81ea5c35cb
|
@ -25,25 +25,8 @@ from PIL import Image
|
|||
import operator, math
|
||||
from functools import reduce
|
||||
|
||||
##
|
||||
# The <b>ImageStat</b> module calculates global statistics for an
|
||||
# image, or a region of an image.
|
||||
##
|
||||
|
||||
##
|
||||
# Calculate statistics for the given image. If a mask is included,
|
||||
# only the regions covered by that mask are included in the
|
||||
# statistics.
|
||||
|
||||
class Stat:
|
||||
"Get image or feature statistics"
|
||||
|
||||
##
|
||||
# Create a statistics object.
|
||||
#
|
||||
# @def __init__(image, mask=None)
|
||||
# @param image A PIL image, or a precalculate histogram.
|
||||
# @param mask An optional mask.
|
||||
|
||||
def __init__(self, image_or_list, mask = None):
|
||||
try:
|
||||
|
|
|
@ -94,14 +94,6 @@ can be found here.
|
|||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`ImageStat` Module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: PIL.ImageStat
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
:mod:`ImageTk` Module
|
||||
---------------------
|
||||
|
||||
|
|
53
docs/reference/ImageStat.rst
Normal file
53
docs/reference/ImageStat.rst
Normal file
|
@ -0,0 +1,53 @@
|
|||
.. 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
|
||||
|
||||
Total number of pixels.
|
||||
|
||||
.. py:attribute:: sum
|
||||
|
||||
Sum of all pixels.
|
||||
|
||||
.. py:attribute:: sum2
|
||||
|
||||
Squared sum of all pixels.
|
||||
|
||||
.. py:attribute:: pixel
|
||||
|
||||
Average pixel level.
|
||||
|
||||
.. py:attribute:: median
|
||||
|
||||
Median pixel level.
|
||||
|
||||
.. py:attribute:: rms
|
||||
|
||||
RMS (root-mean-square).
|
||||
|
||||
.. py:attribute:: var
|
||||
|
||||
Variance.
|
||||
|
||||
.. py:attribute:: stddev
|
||||
|
||||
Standard deviation.
|
|
@ -19,4 +19,5 @@ Reference
|
|||
ImagePath
|
||||
ImageQt
|
||||
ImageSequence
|
||||
ImageStat
|
||||
../PIL
|
||||
|
|
Loading…
Reference in New Issue
Block a user