skimage 0.17.2

ParametersReturnsBackRef
histogram(image, nbins=256, source_range='image', normalize=False)

Unlike numpy.histogram , this function returns the centers of bins and does not rebin integer arrays. For integer arrays, each integer value has its own bin, which improves speed and intensity-resolution.

The histogram is computed on the flattened image: for color images, the function should be used separately on each channel to obtain a histogram for each color channel.

Parameters

image : array

Input image.

nbins : int, optional

Number of bins used to calculate histogram. This value is ignored for integer arrays.

source_range : string, optional

'image' (default) determines the range from the input image. 'dtype' determines the range from the expected range of the images of that data type.

normalize : bool, optional

If True, normalize the histogram by the sum of its values.

Returns

hist : array

The values of the histogram.

bin_centers : array

The values at the center of the bins.

Return histogram of image.

See Also

cumulative_distribution

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage import data, exposure, img_as_float
... image = img_as_float(data.camera())
... np.histogram(image, bins=2) (array([107432, 154712]), array([0. , 0.5, 1. ]))
This example is valid syntax, but we were not able to check execution
>>> exposure.histogram(image, nbins=2)
(array([107432, 154712]), array([0.25, 0.75]))
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.exposure.exposure.cumulative_distribution skimage.exposure.exposure.histogram

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/exposure/exposure.py#77
type: <class 'function'>
Commit: