From 680a89e5ceb2eb7843eca05549fbc90d92cedc4c Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Tue, 31 May 2011 15:50:09 -0400 Subject: [PATCH] Make test_tv_denoise_2d more strict. Original test only checked that tv_denoise reduced the total variation. This change makes sure that the reduction is significant. --- scikits/image/filter/tests/test_tv_denoise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scikits/image/filter/tests/test_tv_denoise.py b/scikits/image/filter/tests/test_tv_denoise.py index 90325c80..d3a921a9 100644 --- a/scikits/image/filter/tests/test_tv_denoise.py +++ b/scikits/image/filter/tests/test_tv_denoise.py @@ -22,7 +22,7 @@ class TestTvDenoise(): grad = ndimage.morphological_gradient(lena, size=((3,3))) grad_denoised = ndimage.morphological_gradient(denoised_lena, size=((3,3))) # test if the total variation has decreased - assert np.sqrt((grad_denoised**2).sum()) < np.sqrt((grad**2).sum()) + assert np.sqrt((grad_denoised**2).sum()) < np.sqrt((grad**2).sum()) / 2 denoised_lena_int = F.tv_denoise(lena.astype(np.int32), \ weight=60.0, keep_type=True) assert denoised_lena_int.dtype is np.dtype('int32')