diff --git a/skimage/deconvolution/uft.py b/skimage/deconvolution/uft.py index 6f80a22d..a592f8d7 100644 --- a/skimage/deconvolution/uft.py +++ b/skimage/deconvolution/uft.py @@ -332,17 +332,6 @@ def image_quad_norm(inarray): return np.sum(np.sum(np.abs(inarray)**2, axis=-1), axis=-1) -def crandn(shape): - """white complex gaussian noise - - Generate directly the unitary Fourier transform of white gaussian - noise noise field (with given shape) of zero mean and variance - unity (ie N(0,1)). - """ - return np.sqrt(0.5) * (np.random.standard_normal(shape) + - 1j * np.random.standard_normal(shape)) - - def ir2tf(imp_resp, shape, dim=None, real=True): """Compute the transfer function of IR diff --git a/skimage/deconvolution/wiener.py b/skimage/deconvolution/wiener.py index 2247d619..762499c5 100644 --- a/skimage/deconvolution/wiener.py +++ b/skimage/deconvolution/wiener.py @@ -266,7 +266,9 @@ def unsupervised_wiener(data, psf, reg=None, user_params=None): # weighing (correlation in direct space) precision = gn_chain[-1] * atf2 + gx_chain[-1] * areg2 # Eq. 29 - excursion = uft.crandn(data.shape) / np.sqrt(precision) + excursion = np.sqrt(0.5) / np.sqrt(precision) * ( + np.random.standard_normal(data.shape) + + 1j * np.random.standard_normal(data.shape)) # mean Eq. 30 (RLS for fixed gn, gamma0 and gamma1 ...) wiener_filter = gn_chain[-1] * np.conj(trans_fct) / precision