skimage 0.17.2

NotesOther ParametersParametersReturnsBackRef
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.

Notes

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.

Other Parameters

The keys of ``user_params`` are: :
threshold : float

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.

burnin : int

The number of sample to ignore to start computation of the mean. 15 by default.

min_iter : int

The minimum number of iterations. 30 by default.

max_iter : int

The maximum number of iterations if threshold is not satisfied. 200 by default.

callback : callable (None 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.

Parameters

image : (M, N) ndarray

The input degraded image.

psf : ndarray

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) ).

reg : ndarray, optional

The regularisation operator. The Laplacian by default. It can be an impulse response or a transfer function, as for the psf.

user_params : dict, optional

Dictionary of parameters for the Gibbs sampler. See below.

clip : boolean, optional

True by default. If true, pixel values of the result above 1 or under -1 are thresholded for skimage pipeline compatibility.

Returns

x_postmean : (M, N) ndarray

The deconvolved image (the posterior mean).

chains : dict

The keys noise and prior contain the chain list of noise and prior precision respectively.

Unsupervised Wiener-Hunt deconvolution.

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage import color, data, restoration
... 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)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.restoration.deconvolution.unsupervised_wiener

Local connectivity graph

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


File: /skimage/restoration/deconvolution.py#140
type: <class 'function'>
Commit: