From fe4956049bb3e9b524bf6931d50b75ccf49d03db Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 28 Sep 2011 20:57:51 -0700 Subject: [PATCH] BUG: Adopt lena example to use new data module. --- doc/examples/plot_lena_tv_denoise.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/examples/plot_lena_tv_denoise.py b/doc/examples/plot_lena_tv_denoise.py index a712acee..700f87d6 100644 --- a/doc/examples/plot_lena_tv_denoise.py +++ b/doc/examples/plot_lena_tv_denoise.py @@ -19,18 +19,16 @@ the tradeoff between denoising and faithfulness to the original image. import numpy as np import matplotlib.pyplot as plt -from scikits.image import data -from scikits.image import color +from scikits.image import data, color, img_as_ubyte from scikits.image.filter import tv_denoise -l = color.rgb2gray(data.lena()) +l = img_as_ubyte(color.rgb2gray(data.lena())) l = l[230:290, 220:320] -noisy = l + 0.4*l.std()*np.random.random(l.shape) +noisy = l + 0.4 * l.std() * np.random.random(l.shape) tv_denoised = tv_denoise(noisy, weight=10) - plt.figure(figsize=(12,2.8)) plt.subplot(131)