mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-08 06:11:19 +08:00
Remove thresholding example from user guide in favor of docstring example.
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
"""
|
||||
============
|
||||
Thresholding
|
||||
============
|
||||
|
||||
Thresholding is used to create a binary image. This example uses Otsu's method to calculate the threshold value.
|
||||
|
||||
"""
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from skimage.data import camera
|
||||
from skimage.thresholding import threshold_otsu
|
||||
|
||||
|
||||
image = camera()
|
||||
thresh = threshold_otsu(camera())
|
||||
binary = image > thresh
|
||||
|
||||
plt.imshow(binary)
|
||||
plt.axis('off')
|
||||
plt.show()
|
||||
|
||||
@@ -24,6 +24,12 @@ def threshold_otsu(image, bins=256):
|
||||
----------
|
||||
.. [1] Wikipedia, http://en.wikipedia.org/wiki/Otsu's_Method
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage.data import camera
|
||||
>>> image = camera()
|
||||
>>> thresh = threshold_otsu(camera())
|
||||
>>> binary = image > thresh
|
||||
"""
|
||||
hist, bin_centers = histogram(image, bins)
|
||||
hist = hist.astype(float)
|
||||
|
||||
Reference in New Issue
Block a user