From efb829f876a5fdff62445b7cd7f79de280734f3b Mon Sep 17 00:00:00 2001 From: "Gregory R. Lee" Date: Wed, 10 Aug 2016 18:45:39 -0400 Subject: [PATCH] TST: update existing tests for wavelet_denoise --- skimage/restoration/tests/test_denoise.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/skimage/restoration/tests/test_denoise.py b/skimage/restoration/tests/test_denoise.py index 383d0f96..7ee1acd1 100644 --- a/skimage/restoration/tests/test_denoise.py +++ b/skimage/restoration/tests/test_denoise.py @@ -310,16 +310,20 @@ def test_no_denoising_for_small_h(): def test_wavelet_denoising(): - for img in [astro_gray, astro]: + for img, multichannel in [(astro_gray, False), (astro, True)]: noisy = img.copy() + 0.1 * np.random.randn(*(img.shape)) noisy = np.clip(noisy, 0, 1) # less energy in signal - denoised = restoration.denoise_wavelet(noisy, sigma=0.3) + denoised = restoration.denoise_wavelet(noisy, sigma=0.3, + multichannel=multichannel) assert denoised.sum()**2 <= img.sum()**2 # test changing noise_std (higher threshold, so less energy in signal) - assert (restoration.denoise_wavelet(noisy, sigma=0.2).sum()**2 <= - restoration.denoise_wavelet(noisy, sigma=0.1).sum()**2) + res1 = restoration.denoise_wavelet(noisy, sigma=0.2, + multichannel=multichannel) + res2 = restoration.denoise_wavelet(noisy, sigma=0.1, + multichannel=multichannel) + assert (res1.sum()**2 <= res2.sum()**2) if __name__ == "__main__":