Histogram#

class Histogram(image: ImageWholeFeaturesMixin, nbins: int = 256, sorted: bool | str = False, span: Literal['dtype'] | tuple[float, float] | None = 'dtype', clip: bool = False, opt: str | None = None)[source]#

Create histogram instance

Parameters:
  • image (Image) – image to histogram

  • nbins (int, optional) – number of histogram bins, defaults to 256

  • sorted (bool) – sort bins by count rather than value, defaults to False

  • span (str, tuple(float, float), None) – histogram span definition, defaults to 'dtype'; 'dtype' means full span of image type, None means finite data min/max, (a,b) means explicit range

  • clip (bool, optional) – clip out-of-span values to span endpoints before binning, defaults to False. If False, out-of-span values are ignored.

  • opt (str, optional) – deprecated histogram option string, use sorted instead; supported legacy value is 'sorted'

Create Histogram instance by computing the histogram over each image plane.

Seealso:

hist

Methods

peaks(**kwargs)

Histogram peaks

plot([type, block, filled, stats, style, ...])

Plot histogram

Properties

cdf

Cumulative histogram values

h

Histogram count values

ncdf

Normalized cumulative histogram values

x

Histogram bin values