Image Processing Toolbox User's Guide |
Restore image using the Wiener filter
Syntax
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.
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
, double
, or single
. Other inputs have to be of class double
. J
has the same class as I
.
Example
I = checkerboard(8); noise = 0.1*randn(size(I)); PSF = fspecial('motion',21,11); Blurred = imfilter(I,PSF,'circular'); BlurredNoisy = im2uint8(Blurred + noise);
NSR = sum(noise(:).^2)/sum(I(:).^2);% noise-to-power ratio NP = abs(fftn(noise)).^2;% noise power NPOW = sum(NP(:))/prod(size(noise)); NCORR = fftshift(real(ifftn(NP)));% noise autocorrelation function, centered IP = abs(fftn(I)).^2;% original image power IPOW = sum(IP(:))/prod(size(I)); ICORR = fftshift(real(ifftn(IP)));% image autocorrelation function, centered ICORR1 = ICORR(:,ceil(size(I,1)/2)); 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
deconvreg | decorrstretch |
© 1994-2005 The MathWorks, Inc.