From f143f4b39efeb8008dc9c085aa42e692a1e29b7c Mon Sep 17 00:00:00 2001 From: "Gregory R. Lee" Date: Wed, 23 Dec 2015 12:29:37 -0500 Subject: [PATCH] Change default weight for denoise_tv_chambolle to a value that is reasonable for float images scaled to the [0, 1] range --- skimage/restoration/_denoise.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/skimage/restoration/_denoise.py b/skimage/restoration/_denoise.py index 16fd07df..492c606b 100644 --- a/skimage/restoration/_denoise.py +++ b/skimage/restoration/_denoise.py @@ -31,7 +31,7 @@ def denoise_bilateral(image, win_size=5, sigma_range=None, sigma_spatial=1, similarity). A larger value results in averaging of pixels with larger radiometric differences. Note, that the image will be converted using the `img_as_float` function and thus the standard deviation is in - respect to the range ``[0, 1]``. If the value is ``None`` the standard + respect to the range ``[0, 1]``. If the value is ``None`` the standard deviation of the ``image`` will be used. sigma_spatial : float Standard deviation for range distance. A larger value results in @@ -116,7 +116,7 @@ def denoise_tv_bregman(image, weight, max_iter=100, eps=1e-3, isotropic=True): return _denoise_tv_bregman(image, weight, max_iter, eps, isotropic) -def _denoise_tv_chambolle_3d(im, weight=100, eps=2.e-4, n_iter_max=200): +def _denoise_tv_chambolle_3d(im, weight=0.2, eps=2.e-4, n_iter_max=200): """Perform total-variation denoising on 3D images. Parameters @@ -189,7 +189,7 @@ def _denoise_tv_chambolle_3d(im, weight=100, eps=2.e-4, n_iter_max=200): return out -def _denoise_tv_chambolle_2d(im, weight=50, eps=2.e-4, n_iter_max=200): +def _denoise_tv_chambolle_2d(im, weight=0.2, eps=2.e-4, n_iter_max=200): """Perform total-variation denoising on 2D images. Parameters @@ -265,7 +265,7 @@ def _denoise_tv_chambolle_2d(im, weight=50, eps=2.e-4, n_iter_max=200): return out -def denoise_tv_chambolle(im, weight=50, eps=2.e-4, n_iter_max=200, +def denoise_tv_chambolle(im, weight=0.2, eps=2.e-4, n_iter_max=200, multichannel=False): """Perform total-variation denoising on 2D and 3D images.