machinevisiontoolbox.Image.median

Image.median(*args, **kwargs)[source]

Median value of all pixels

Parameters:
Returns:

median value

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('flowers1.png')
>>> img.median()
92.0
>>> img = Image.Read('flowers1.png', dtype='float32')
>>> img.median()
0.36078432
Note:
  • The return value type is the same as the image type.

  • By default the result is a scalar computed over all pixels, if the axis option is given the results is a 1D or 2D NumPy array.

Seealso:

numpy.median