class Statistics – Statistics Object

The statistics object is an attrtuple returned by histogram.get_statistics() (and its aliases histogram.get_stats() / histogram.statistics()) or directly by Image.get_statistics(). It summarises the bin distribution of the underlying Histogram with eight reductions per channel: mean, median, mode, standard deviation, min, max, lower quartile, and upper quartile.

For grayscale data, only the un-prefixed fields (mean, median, mode, stdev, min, max, lq, uq) carry useful values and they are reused as the LAB L channel reductions for RGB565 data – the l_* fields therefore mirror the un-prefixed fields and are provided for symmetry. a_* and b_* only carry useful values for RGB565 histograms.

Fields are accessible by attribute name (statistics.mean) or by index (statistics[0]). The object has no public constructor.

class image.statistics

Please call histogram.get_statistics() or Image.get_statistics() to create this object.

Grayscale / LAB L (also exposed as l_* below)

mean

Grayscale mean of the histogram. Integer 0 – 255. Index [0].

median

Grayscale median of the histogram. Integer 0 – 255. Index [1].

mode

Grayscale mode of the histogram. Integer 0 – 255. Index [2].

stdev

Grayscale standard deviation of the histogram. Integer 0 – 255. Index [3].

min

Grayscale minimum of the histogram. Integer 0 – 255. Index [4].

max

Grayscale maximum of the histogram. Integer 0 – 255. Index [5].

lq

Grayscale lower quartile (25th percentile) of the histogram. Integer 0 – 255. Index [6].

uq

Grayscale upper quartile (75th percentile) of the histogram. Integer 0 – 255. Index [7].

LAB L channel (RGB565)

l_mean

LAB L channel mean. Integer 0 – 100. Index [8].

l_median

LAB L channel median. Integer 0 – 100. Index [9].

l_mode

LAB L channel mode. Integer 0 – 100. Index [10].

l_stdev

LAB L channel standard deviation. Integer 0 – 100. Index [11].

l_min

LAB L channel minimum. Integer 0 – 100. Index [12].

l_max

LAB L channel maximum. Integer 0 – 100. Index [13].

l_lq

LAB L channel lower quartile. Integer 0 – 100. Index [14].

l_uq

LAB L channel upper quartile. Integer 0 – 100. Index [15].

LAB A channel (RGB565)

a_mean

LAB A channel mean. Integer -128 – 127. Index [16].

a_median

LAB A channel median. Integer -128 – 127. Index [17].

a_mode

LAB A channel mode. Integer -128 – 127. Index [18].

a_stdev

LAB A channel standard deviation. Integer -128 – 127. Index [19].

a_min

LAB A channel minimum. Integer -128 – 127. Index [20].

a_max

LAB A channel maximum. Integer -128 – 127. Index [21].

a_lq

LAB A channel lower quartile. Integer -128 – 127. Index [22].

a_uq

LAB A channel upper quartile. Integer -128 – 127. Index [23].

LAB B channel (RGB565)

b_mean

LAB B channel mean. Integer -128 – 127. Index [24].

b_median

LAB B channel median. Integer -128 – 127. Index [25].

b_mode

LAB B channel mode. Integer -128 – 127. Index [26].

b_stdev

LAB B channel standard deviation. Integer -128 – 127. Index [27].

b_min

LAB B channel minimum. Integer -128 – 127. Index [28].

b_max

LAB B channel maximum. Integer -128 – 127. Index [29].

b_lq

LAB B channel lower quartile. Integer -128 – 127. Index [30].

b_uq

LAB B channel upper quartile. Integer -128 – 127. Index [31].