mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-12 20:45:35 +08:00
Reduce runtime of long doctests
This commit is contained in:
@@ -30,14 +30,6 @@ def _denoise_tv_chambolle_3d(im, weight=100, eps=2.e-4, n_iter_max=200):
|
||||
-----
|
||||
Rudin, Osher and Fatemi algorithm.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> x, y, z = np.ogrid[0:40, 0:40, 0:40]
|
||||
>>> mask = (x - 22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2
|
||||
>>> mask = mask.astype(np.float)
|
||||
>>> mask += 0.2 * np.random.randn(*mask.shape)
|
||||
>>> res = denoise_tv_chambolle(mask, weight=100)
|
||||
|
||||
"""
|
||||
|
||||
px = np.zeros_like(im)
|
||||
@@ -121,13 +113,6 @@ def _denoise_tv_chambolle_2d(im, weight=50, eps=2.e-4, n_iter_max=200):
|
||||
applications, Journal of Mathematical Imaging and Vision,
|
||||
Springer, 2004, 20, 89-97.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage import color, data
|
||||
>>> lena = color.rgb2gray(data.lena())
|
||||
>>> lena += 0.5 * lena.std() * np.random.randn(*lena.shape)
|
||||
>>> denoised_lena = denoise_tv_chambolle(lena, weight=60)
|
||||
|
||||
"""
|
||||
|
||||
px = np.zeros_like(im)
|
||||
@@ -224,13 +209,13 @@ def denoise_tv_chambolle(im, weight=50, eps=2.e-4, n_iter_max=200,
|
||||
2D example on Lena image:
|
||||
|
||||
>>> from skimage import color, data
|
||||
>>> lena = color.rgb2gray(data.lena())
|
||||
>>> lena = color.rgb2gray(data.lena())[:50, :50]
|
||||
>>> lena += 0.5 * lena.std() * np.random.randn(*lena.shape)
|
||||
>>> denoised_lena = denoise_tv_chambolle(lena, weight=60)
|
||||
|
||||
3D example on synthetic data:
|
||||
|
||||
>>> x, y, z = np.ogrid[0:40, 0:40, 0:40]
|
||||
>>> x, y, z = np.ogrid[0:20, 0:20, 0:20]
|
||||
>>> mask = (x - 22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2
|
||||
>>> mask = mask.astype(np.float)
|
||||
>>> mask += 0.2*np.random.randn(*mask.shape)
|
||||
|
||||
@@ -57,7 +57,7 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0,
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage.data import camera
|
||||
>>> image = camera()
|
||||
>>> image = camera()[:50, :50]
|
||||
>>> binary_image1 = threshold_adaptive(image, 15, 'mean')
|
||||
>>> func = lambda arr: arr.mean()
|
||||
>>> binary_image2 = threshold_adaptive(image, 15, 'generic', param=func)
|
||||
|
||||
Reference in New Issue
Block a user