lvinverse(3)

LIBRARY ROUTINE
lvinverse - Perform image restoration by inverse filtering in the frequency domain.

LIBRARY CALL
#include "vinclude.h"
int
lvinverse(f1,f2,f3,bflg,thresh)
struct xvimage *f1, *f2, *f3;
int  bflg;
float thresh;

INPUT

    1. f1 -- first xvimage structure; FFT of image to be restored
    2. f2 -- second xvimage structure; FFT of reference image
             (optional)
    3. f3 -- third xvimage structure; FFT of PSF function
    4. bflg -- a flag set if reference image is available
    5. thresh -- minimum PSF threshold (optional)

    The input xvimage structures must be of the same data type and size.

OUTPUT

    1. f1 -- holds the result of the inverse filtering
             operation.
    2. f3 -- holds the effective Point Spread Function
             (PSF) xvimage structure.

    The output data type is the same as the input data type.

    f1 is used for both the input xvimage structure and the output result xvimage structure. This is done to save space.

    lvinverse returns a zero upon failure and a one upon success.

MODIFICATIONS

Scott Wilson - Removed redundant call to cang(), added if() on p2+=2 21-Aug-90

Scott Wilson - 27-Jan-91 - Removed FFT data type processing

DESCRIPTION
lvinverse performs restoration of images in the spatial domain by inverse filtering in the frequency domain. The idea is to deconvolve the blurring function from the blurred image. A few problems exist in performing this operation, as described in great detail in any good image processing book.

The major difficulty lies in how small the denominator is allowed to be before you call it garbage. The value chosen is supplied as the -t thresh value. Ideally, this will be just above the noise floor in the image, but experimentation is the best guide here.

The reffile (reference image) is an image which, if supplied, is subtracted from the input image before the inverse filter is applied. This is handy for removing some constant background from the image before the restoration is done.

The PSFfile (PSF function) is the transform of the Point-Spread Function, or blurring function that is to be deconvolved from the input image.

The effPSFfile (effective PSF function) is the same as the PSFfile after the thresholding operation has been applied. Taking the inverse Fourier transform of this file gives the effective PSF as used in the restoration. The idea is that is should be reasonably close to the real PSF.

SEE ALSO
vinverse(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
all images must be of the same data type (VFF_TYP_COMPLEX) and size.

AUTHOR
Scott Wilson

COPYRIGHT
Copyright 1992, University of New Mexico. All rights reserved.