Rename denoise_tv to denoise_tv_bregman

This commit is contained in:
Johannes Schönberger
2012-12-25 10:44:19 +01:00
parent fff33702ea
commit 780d886db9
3 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -3,6 +3,6 @@ from .ctmf import median_filter
from ._canny import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt)
from ._denoise import denoise_bilateral, denoise_tv, tv_denoise
from ._denoise import denoise_bilateral, denoise_tv_bregman
from ._rank_order import rank_order
from .thresholding import threshold_otsu, threshold_adaptive
+1 -3
View File
@@ -179,7 +179,7 @@ def denoise_bilateral(image, int win_size=5, sigma_range=None,
return np.squeeze(out)
def denoise_tv(image, double weight, int max_iter=100, double eps=1e-3):
def denoise_tv_bregman(image, double weight, int max_iter=100, double eps=1e-3):
"""Perform total-variation denoising using split-Bregman optimization.
Total-variation denoising (also know as total-variation regularization)
@@ -314,5 +314,3 @@ def denoise_tv(image, double weight, int max_iter=100, double eps=1e-3):
i += 1
return np.squeeze(u[1:-1, 1:-1])
tv_denoise = deprecated('skimage.filter.denoise_tv')(denoise_tv)
+5 -5
View File
@@ -14,8 +14,8 @@ def test_denoise_tv_2d():
img += 0.5 * img.std() * np.random.random(img.shape)
img = np.clip(img, 0, 1)
out1 = filter.denoise_tv(img, weight=10)
out2 = filter.denoise_tv(img, weight=5)
out1 = filter.denoise_tv_bregman(img, weight=10)
out2 = filter.denoise_tv_bregman(img, weight=5)
# make sure noise is reduced
assert img.std() > out1.std()
@@ -27,7 +27,7 @@ def test_denoise_tv_float_result_range():
img = lena_gray
int_lena = np.multiply(img, 255).astype(np.uint8)
assert np.max(int_lena) > 1
denoised_int_lena = filter.denoise_tv(int_lena, weight=60.0)
denoised_int_lena = filter.denoise_tv_bregman(int_lena, weight=60.0)
# test if the value range of output float data is within [0.0:1.0]
assert denoised_int_lena.dtype == np.float
assert np.max(denoised_int_lena) <= 1.0
@@ -40,8 +40,8 @@ def test_denoise_tv_3d():
img += 0.5 * img.std() * np.random.random(img.shape)
img = np.clip(img, 0, 1)
out1 = filter.denoise_tv(img, weight=10)
out2 = filter.denoise_tv(img, weight=5)
out1 = filter.denoise_tv_bregman(img, weight=10)
out2 = filter.denoise_tv_bregman(img, weight=5)
# make sure noise is reduced
assert img.std() > out1.std()