Image Processing Toolbox User's Guide |
Restore image using the blind deconvolution algorithm
Syntax
[J,PSF] = deconvblind(I,INITPSF) [J,PSF] = deconvblind(I,INITPSF,NUMIT) [J,PSF] = deconvblind(I,INITPSF,NUMIT,DAMPAR) [J,PSF] = deconvblind(I,INITPSF,NUMIT,DAMPAR,WEIGHT) [J,PSF] = deconvblind(I,INITPSF,NUMIT,DAMPAR,WEIGHT,READOUT) [J,PSF] = deconvblind(...,FUN)
Description
[J,PSF] =
deconvblind(I,INITPSF)
deconvolves image I
using the maximum likelihood algorithm, returning both the deblurred image J
and a restored point-spread function PSF
. The input array I
and your initial guess at the PSF INITPSF
can be numeric arrays or cell arrays. (Use cell arrays when you want to be able to perform additional deconvolutions that start where your initial deconvolution finished. The restored PSF
is a positive array that is the same size as INITPSF
, normalized so its sum adds up to 1.
Note
The PSF restoration is affected strongly by the size of the initial guess INITPSF and less by the values it contains. For this reason, specify an array of 1's as your INITPSF .
|
To improve the restoration, deconvblind
supports several optional parameters, described below. Use []
as a placeholder if you do not specify an intermediate parameter.
[J,PSF] =
deconvblind(I,INITPSF,NUMIT)
specifies the number of iterations (default is 10).
[J,PSF] =
deconvblind(I,INITPSF,NUMIT,DAMPAR)
specifies the threshold deviation of the resulting image from the input image I
(in terms of the standard deviation of Poisson noise) below which damping occurs. The iterations are suppressed for the pixels that deviate within the DAMPAR
value from their original value. This suppresses the noise generation in such pixels, preserving necessary image details elsewhere. The default value is 0
(no damping).
[J,PSF] =
deconvblind(I,INITPSF,NUMIT,DAMPAR,WEIGHT)
specifies which pixels in the input image I
are considered in the restoration. By default, WEIGHT
is a unit array, the same size as the input image. You can assign a value between 0.0 and 1.0 to elements in the WEIGHT
array. The value of an element in the WEIGHT
array determines how much the pixel at the corresponding position in the input image is considered. For example, to exclude a pixel from consideration, assign it a value of 0
in the WEIGHT
array. You can adjust the weight value assigned to each pixel according to the amount of flat-field correction.
[J,PSF] =
deconvblind(I,INITPSF,NUMIT,DAMPAR,WEIGHT,READOUT)
, where READOUT
is an array (or a value) corresponding to the additive noise (e.g., background, foreground noise) and the variance of the read-out camera noise. READOUT
has to be in the units of the image. The default value is 0
.
[J,PSF] = deconvblind(...,FUN,P1,P2,...,PN)
, where FUN
is a function describing additional constraints on the PSF. FUN
must be a function handle.
FUN
is called at the end of each iteration. FUN
must accept the PSF
as its first argument and can accept additional parameters P1
, P2
,...
, PN
. The FUN
function should return one argument, PSF
, that is the same size as the original PSF and that satisfies the positivity and normalization constraints.
Note
The output image J could exhibit ringing introduced by the discrete Fourier transform used in the algorithm. To reduce the ringing, use I = edgetaper(I,PSF) before calling deconvblind .
|
Resuming Deconvolution
You can use deconvblind
to perform a deconvolution that starts where a previous deconvolution stopped. To use this feature, pass the input image I
and the initial guess at the PSF, INITPSF
, as cell arrays: {I}
and {INITPSF}
. When you do, the deconvblind
function returns the output image J
and the restored point-spread function, PSF
, as cell arrays, which can then be passed as the input arrays into the next deconvblind
call. The output cell array J
contains four elements:
J{1}
contains I
, the original image.
J{2}
contains the result of the last iteration.
Class Support
I
and INITPSF
can be uint8
, uint16
, int16
, double
, or single
. DAMPAR
and READOUT
must have the same class as the input image. Other inputs have to be double
. The output image J
(or the first array of the output cell) has the same class as the input image I
. The output PSF
is double
.
Example
I = checkerboard(8); PSF = fspecial('gaussian',7,10); V = .0001; BlurredNoisy = imnoise(imfilter(I,PSF),'gaussian',0,V); WT = zeros(size(I)); WT(5:end-4,5:end-4) = 1; INITPSF = ones(size(PSF)); FUN = @(PSF,P1) PSF + P1; [J P]= deconvblind(BlurredNoisy,INITPSF,20,10*sqrt(V),WT,FUN,0); subplot(221);imshow(BlurredNoisy); title('A = Blurred and Noisy'); subplot(222);imshow(PSF,[]); title('True PSF'); subplot(223);imshow(J); title('Deblured Image'); subplot(224);imshow(P,[]); title('Recovered PSF');
See Also
deconvlucy
, deconvreg
, deconvwnr
, edgetaper
, function_handle
, imnoise
, otf2psf
, padarray
, psf2otf
dctmtx | deconvlucy |
© 1994-2005 The MathWorks, Inc.