mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-28 11:25:42 +08:00
DOC: Explain why bincount is used to histogram integer arrays.
This commit is contained in:
@@ -28,6 +28,8 @@ def histogram(image, nbins=256):
|
||||
bin_centers : array
|
||||
The values at the center of the bins.
|
||||
"""
|
||||
|
||||
# For integer types, histogramming with bincount is more efficient.
|
||||
if np.issubdtype(image.dtype, np.integer):
|
||||
offset = 0
|
||||
if np.min(image) < 0:
|
||||
|
||||
Reference in New Issue
Block a user