Main Content

deconvreg

Deblur image using regularized filter

Description

example

J= deconvreg(I,psf)deconvolves imageIusing the regularized filter algorithm, returning deblurred imageJ. The assumption is that the imageIwas created by convolving a true image with a point-spread function (PSF),psf, and possibly by adding noise. The algorithm is a constrained optimum in the sense of least square error between the estimated and the true images under requirement of preserving image smoothness.

J= deconvreg(I,psf,np)specifies the additive noise power,np.

J= deconvreg(I,psf,np,lrange)specifies the range,lrange, where the search for the optimal solution is performed. The algorithm finds an optimal Lagrange multiplierlagrawithin thelrangerange.

J= deconvreg(I,psf,np,lrange,regop)constrains the deconvolution using regularization operatorregop. The default regularization operator is the Laplacian operator, to retain the image smoothness.

[J,lagra] = deconvreg(___)outputs the value of the Lagrange multiplier,lagrain addition to the restored image,J.

Examples

collapse all

Create sample image.

I = checkerboard(8);

Create PSF and use it to create a blurred and noisy version of the input image.

PSF = fspecial('gaussian',7,10); V = .01; BlurredNoisy = imnoise(imfilter(I,PSF),'gaussian',0,V); NOISEPOWER = V*prod(size(I));

Deblur the image.

[J LAGRA] = deconvreg(BlurredNoisy,PSF,NOISEPOWER);

Display the various versions of the image.

subplot(221); imshow(BlurredNoisy); title('A = Blurred and Noisy'); subplot(222); imshow(J); title('[J LAGRA] = deconvreg(A,PSF,NP)'); subplot(223); imshow(deconvreg(BlurredNoisy,PSF,[],LAGRA/10)); title(“deconvreg(A,PSF,[],0.1*LAGRA)'); subplot(224); imshow(deconvreg(BlurredNoisy,PSF,[],LAGRA*10)); title(“deconvreg(A,PSF,[],10*LAGRA)');

图包含4轴objects. Axes object 1 with title A = Blurred and Noisy contains an object of type image. Axes object 2 with title [J LAGRA] = deconvreg(A,PSF,NP) contains an object of type image. Axes object 3 with title deconvreg(A,PSF,[],0.1*LAGRA) contains an object of type image. Axes object 4 with title deconvreg(A,PSF,[],10*LAGRA) contains an object of type image.

Input Arguments

collapse all

Blurry image, specified as a numeric array of any dimension.

Data Types:single|double|int16|uint8|uint16

PSF, specified as a numeric array.

Data Types:double

Noise power, specified as a numeric scalar.

Data Types:double

Search range, specified as a numeric scalar or a 2-element numeric vector. Iflrangeis a scalar, then the algorithm assumes thatlagrais equal tolrange. If you specifylagra, then the function ignores thenpvalue

Data Types:double

Regularization operator, specified as a numeric array. Theregoparray dimensions must not exceed the dimensions of the image,I. Any nonsingleton dimensions must correspond to the nonsingleton dimensions ofpsf.

Data Types:double

Output Arguments

collapse all

Deblurred image, returned as a numeric array.Jhas the same data type asI.

Lagrange multiplier, returned as a numeric scalar.

Tips

  • The output imageJcould exhibit ringing introduced by the discrete Fourier transform used in the algorithm. To reduce the ringing, useI = edgetaper(I,psf)before callingdeconvreg.

References

[1]Gonzalez, R. C., and R. E. Woods.Digital Image Processing. Addison-Wesley Publishing Company, Inc., 1992.

Version History

之前介绍过的R2006a