histogram example

This commit is contained in:
Emmanuelle Gouillart
2013-04-20 19:53:58 +02:00
parent ecba2df2ac
commit 3f47aefa90
+9
View File
@@ -14,6 +14,7 @@ __all__ = ['histogram', 'cumulative_distribution', 'equalize',
def histogram(image, nbins=256):
"""Return histogram of image.
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.
@@ -32,6 +33,14 @@ def histogram(image, nbins=256):
The values of the histogram.
bin_centers : array
The values at the center of the bins.
Examples
--------
>>> camera = skimage.data.camera()
>>> hi = exposure.histogram(camera)
>>> # Plot histogram
>>> import matplotlib.pyplot as plt
>>> plt.plot(hi[1], hi[0])
"""
# For integer types, histogramming with bincount is more efficient.