Whitespace...

This commit is contained in:
François Orieux
2013-12-10 22:45:09 +01:00
parent c942ad54c7
commit 4b233098e7
2 changed files with 9 additions and 11 deletions
@@ -12,10 +12,10 @@ def test_wiener():
data = convolve2d(test_img, psf, 'same')
np.random.seed(0)
data += 0.1 * data.std() * np.random.standard_normal(data.shape)
deconvolued = deconvolution.wiener(data, psf, 25)
deconvolved = deconvolution.wiener(data, psf, 25)
path = pjoin(dirname(abspath(__file__)), 'camera_wiener.npy')
np.testing.assert_allclose(deconvolued, np.load(path))
np.testing.assert_allclose(deconvolved, np.load(path))
def test_unsupervised_wiener():
@@ -23,12 +23,10 @@ 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)
deconvolued, _ = deconvolution.unsupervised_wiener(data, psf)
deconvolved, _ = deconvolution.unsupervised_wiener(data, psf)
path = pjoin(dirname(abspath(__file__)), 'camera_unsup.npy')
np.testing.assert_allclose(deconvolued, np.load(path))
return data, deconvolued
np.testing.assert_allclose(deconvolved, np.load(path))
def test_richardson_lucy():
+5 -5
View File
@@ -91,14 +91,14 @@ def wiener(data, psf, reg_val, reg=None, real=True):
-----
This function apply the wiener filter to a noisy and convolued
image. If the data model is
.. math:: y = Hx + n
where :math:`n is the noise`, :math:`H` the psf and :math:`x` the
unknown original image, the wiener filter is
.. math:: \hat x = F^\dag (|\Lambda_H|^2 + \lambda |\Lambda_D|^2) \Lambda_H^\dag F y
where :math:`F` and :math:`F^\dag` is the Fourier and inverse
Fourier transfrom, :math:`\Lambda_H` the transfert function (or
the Fourier transfrom of the PSF, see [2]) and :math:`\Lambda_D`
@@ -109,7 +109,7 @@ def wiener(data, psf, reg_val, reg=None, real=True):
These methods are then specifique to a prior model that must be
adequate. They could be refered to bayesian approaches.
References
----------
.. [1] François Orieux, Jean-François Giovannelli, and Thomas
@@ -124,7 +124,7 @@ def wiener(data, psf, reg_val, reg=None, real=True):
.. [2] B. R. Hunt "A matrix theory proof of the discrete
convolution theorem", IEEE Trans. on Audio and
Electroacoustics, vol. au-19, no. 4, pp. 285-288, dec. 1971
"""
if not reg:
reg, _ = uft.laplacian(data.ndim, data.shape)