mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-09 11:33:41 +08:00
Rename deconvolution to restoration
This commit is contained in:
@@ -30,7 +30,7 @@ data learning. This is not common and based on the following publication
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from skimage import color, data, deconvolution
|
||||
from skimage import color, data, restoration
|
||||
|
||||
lena = color.rgb2gray(data.lena())
|
||||
from scipy.signal import convolve2d as conv2
|
||||
@@ -38,7 +38,7 @@ psf = np.ones((5, 5)) / 25
|
||||
lena = conv2(lena, psf, 'same')
|
||||
lena += 0.1 * lena.std() * np.random.standard_normal(lena.shape)
|
||||
|
||||
deconvolued, _ = deconvolution.unsupervised_wiener(lena, psf)
|
||||
deconvolued, _ = restoration.unsupervised_wiener(lena, psf)
|
||||
|
||||
fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(8, 5))
|
||||
|
||||
@@ -50,7 +50,7 @@ ax[0].set_title('Data')
|
||||
|
||||
ax[1].imshow(deconvolued, vmax=lena.max())
|
||||
ax[1].axis('off')
|
||||
ax[1].set_title('Self tuned deconvolution')
|
||||
ax[1].set_title('Self tuned restoration')
|
||||
|
||||
fig.subplots_adjust(wspace=0.02, hspace=0.2,
|
||||
top=0.9, bottom=0.05, left=0, right=1)
|
||||
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Skimage module for image deconvolution
|
||||
"""Skimage module for image restoration
|
||||
|
||||
This module implement various algorithm of the literature for image
|
||||
deconvolution.
|
||||
restoration.
|
||||
|
||||
References
|
||||
----------
|
||||
+4
-4
@@ -5,7 +5,7 @@ from scipy.signal import convolve2d
|
||||
|
||||
import skimage
|
||||
from skimage.data import camera
|
||||
from skimage import deconvolution
|
||||
from skimage import restoration
|
||||
|
||||
test_img = skimage.img_as_float(camera())
|
||||
|
||||
@@ -15,7 +15,7 @@ def test_wiener():
|
||||
data = convolve2d(test_img, psf, 'same')
|
||||
np.random.seed(0)
|
||||
data += 0.1 * data.std() * np.random.standard_normal(data.shape)
|
||||
deconvolved = deconvolution.wiener(data, psf, 0.05)
|
||||
deconvolved = restoration.wiener(data, psf, 0.05)
|
||||
|
||||
path = pjoin(dirname(abspath(__file__)), 'camera_wiener.npy')
|
||||
np.testing.assert_allclose(deconvolved, np.load(path), rtol=1e-3)
|
||||
@@ -26,7 +26,7 @@ def test_unsupervised_wiener():
|
||||
data = convolve2d(test_img, psf, 'same')
|
||||
np.random.seed(0)
|
||||
data += 0.1 * data.std() * np.random.standard_normal(data.shape)
|
||||
deconvolved, _ = deconvolution.unsupervised_wiener(data, psf)
|
||||
deconvolved, _ = restoration.unsupervised_wiener(data, psf)
|
||||
|
||||
path = pjoin(dirname(abspath(__file__)), 'camera_unsup.npy')
|
||||
np.testing.assert_allclose(deconvolved, np.load(path), rtol=1e-3)
|
||||
@@ -37,7 +37,7 @@ def test_richardson_lucy():
|
||||
data = convolve2d(test_img, psf, 'same')
|
||||
np.random.seed(0)
|
||||
data += 0.1 * data.std() * np.random.standard_normal(data.shape)
|
||||
deconvolved = deconvolution.richardson_lucy(data, psf, 5)
|
||||
deconvolved = restoration.richardson_lucy(data, psf, 5)
|
||||
|
||||
path = pjoin(dirname(abspath(__file__)), 'camera_rl.npy')
|
||||
np.testing.assert_allclose(deconvolved, np.load(path), rtol=1e-3)
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# uft.py --- Unitary fourier transform
|
||||
|
||||
# Copyright (c) 2011, 2012, 2013 Fran��ois Orieux <orieux@iap.fr>
|
||||
# Copyright (c) 2011, 2012, 2013 François Orieux <orieux@iap.fr>
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
Reference in New Issue
Block a user