mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-08 00:34:48 +08:00
BUG: Adopt lena example to use new data module.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user