deconvwnr - Deblur image using Wiener filter

Syntax

J = deconvwnr(I, PSF)
J = deconvwnr(I, PSF, NSR)
J = deconvwnr(I, PSF, NCORR, ICORR)

Description

J = deconvwnr(I, PSF) restores image I that was degraded by convolution with a point-spread function PSF and possibly by additive noise. The algorithm is optimal in a sense of least mean square error between the estimated and the true image, and uses the correlation matrices of image and noise. In the absence of noise, the Wiener filter reduces to the ideal inverse filter.

I can be an N-dimensional array.

J = deconvwnr(I, PSF, NSR) where NSR is the noise-to-signal power ratio. NSR could be a scalar or an array of the same size as I. The default value is 0.

J = deconvwnr(I, PSF, NCORR, ICORR) where NCORR and ICORR are the autocorrelation functions of the noise and the original image, respectively. NCORR and ICORR can be of any size or dimension not exceeding the original image. An N-dimensional NCORR or ICORR array corresponds to the autocorrelation within each dimension. A vector NCORR or ICORR represents an autocorrelation function in the first dimension if PSF is a vector. If PSF is an array, the 1-D autocorrelation function is extrapolated by symmetry to all nonsingleton dimensions of PSF. A scalar NCORR or ICORR represents the power of the noise or the image.

Class Support

I can be of class uint8, uint16, int16, single, or double. Other inputs have to be of class double. J has the same class as I.

Examples

I = checkerboard(8);
noise = 0.1*randn(size(I));
PSF = fspecial('motion',21,11);
Blurred = imfilter(I,PSF,'circular');
BlurredNoisy = im2uint8(Blurred + noise);

% noise-to-power ratio
NSR = sum(noise(:).^2)/sum(I(:).^2);

% noise power
NP = abs(fftn(noise)).^2; 
NPOW = sum(NP(:))/prod(size(noise));

% noise autocorrelation function, centered
NCORR = fftshift(real(ifftn(NP))); 

% original image power
IP = abs(fftn(I)).^2;
IPOW = sum(IP(:))/prod(size(I));

% image autocorrelation function, centered
ICORR = fftshift(real(ifftn(IP)));
ICORR1 = ICORR(:,ceil(size(I,1)/2));

% noise to power ratio
NSR = NPOW/IPOW;

subplot(221);imshow(BlurredNoisy,[]);
title('A = Blurred and Noisy');
subplot(222);imshow(deconvwnr(BlurredNoisy,PSF,NSR),[]);
title('deconvwnr(A,PSF,NSR)');
subplot(223);imshow(deconvwnr(BlurredNoisy,PSF,NCORR,ICORR),[]);
title('deconvwnr(A,PSF,NCORR,ICORR)');
subplot(224);imshow(deconvwnr(BlurredNoisy,PSF,NPOW,ICORR1),[]);
title('deconvwnr(A,PSF,NPOW,ICORR_1_D)');

See Also

deconvblind, deconvlucy, deconvreg, otf2psf, padarray, psf2otf

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS