mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 03:19:28 +08:00
Fixes to make doctests pass.
This commit is contained in:
@@ -36,11 +36,11 @@ def histogram(image, nbins=256):
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> camera = skimage.data.camera()
|
||||
>>> hi = exposure.histogram(camera)
|
||||
>>> # Plot histogram
|
||||
>>> from skimage import data
|
||||
>>> hist = histogram(data.camera())
|
||||
>>> import matplotlib.pyplot as plt
|
||||
>>> plt.plot(hi[1], hi[0])
|
||||
>>> plt.plot(hist[1], hist[0]) # doctest: +ELLIPSIS
|
||||
[...]
|
||||
"""
|
||||
|
||||
# For integer types, histogramming with bincount is more efficient.
|
||||
|
||||
@@ -46,7 +46,7 @@ def median_filter(image, radius=2, mask=None, percent=50):
|
||||
--------
|
||||
>>> a = np.ones((5, 5))
|
||||
>>> a[2, 2] = 10 # introduce outlier
|
||||
>>> b = filter.median_filter(a)
|
||||
>>> b = median_filter(a)
|
||||
>>> b[2, 2] # the median filter is good at removing outliers
|
||||
1.0
|
||||
'''
|
||||
|
||||
@@ -103,7 +103,7 @@ def find_contours(array, level,
|
||||
array([[ 1., 0., 0.],
|
||||
[ 0., 0., 0.],
|
||||
[ 0., 0., 0.]])
|
||||
>>> measure.find_contours(a, 0.5)
|
||||
>>> find_contours(a, 0.5)
|
||||
[array([[ 0. , 0.5],
|
||||
[ 0.5, 0. ]])]
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user