mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-07 05:35:50 +08:00
histogram example
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user