unsupervised_wiener(image, psf, reg=None, user_params=None, is_real=True, clip=True)
Return the deconvolution with a Wiener-Hunt approach, where the hyperparameters are automatically estimated. The algorithm is a stochastic iterative process (Gibbs sampler) described in the reference below. See also wiener
function.
The estimated image is design as the posterior mean of a probability law (from a Bayesian analysis). The mean is defined as a sum over all the possible images weighted by their respective probability. Given the size of the problem, the exact sum is not tractable. This algorithm use of MCMC to draw image under the posterior law. The practical idea is to only draw highly probable images since they have the biggest contribution to the mean. At the opposite, the less probable images are drawn less often since their contribution is low. Finally the empirical mean of these samples give us an estimation of the mean, and an exact computation with an infinite sample set.
The stopping criterion: the norm of the difference between to successive approximated solution (empirical mean of object samples, see Notes section). 1e-4 by default.
The number of sample to ignore to start computation of the mean. 15 by default.
The minimum number of iterations. 30 by default.
The maximum number of iterations if threshold
is not satisfied. 200 by default.
A user provided callable to which is passed, if the function exists, the current image sample for whatever purpose. The user can store the sample, or compute other moments than the mean. It has no influence on the algorithm execution and is only for inspection.
The input degraded image.
The impulse response (input image's space) or the transfer function (Fourier space). Both are accepted. The transfer function is automatically recognized as being complex ( np.iscomplexobj(psf)
).
The regularisation operator. The Laplacian by default. It can be an impulse response or a transfer function, as for the psf.
Dictionary of parameters for the Gibbs sampler. See below.
True by default. If true, pixel values of the result above 1 or under -1 are thresholded for skimage pipeline compatibility.
The deconvolved image (the posterior mean).
The keys noise
and prior
contain the chain list of noise and prior precision respectively.
Unsupervised Wiener-Hunt deconvolution.
>>> from skimage import color, data, restorationSee :
... img = color.rgb2gray(data.astronaut())
... from scipy.signal import convolve2d
... psf = np.ones((5, 5)) / 25
... img = convolve2d(img, psf, 'same')
... img += 0.1 * img.std() * np.random.standard_normal(img.shape)
... deconvolved_img = restoration.unsupervised_wiener(img, psf)
The following pages refer to to this document either explicitly or contain code examples using this.
skimage.restoration.deconvolution.unsupervised_wiener
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them