Help for WIENER

This program modifies a fourier transform using the Wiener noise additive
model for restoration.  It was developed as part of the procedure RESTORW,
but may also be used in stand-alone mode.

EXECUTION:
  WIENER  INP=(in,otf,otfout)  OUT

 where:  in is the fft of the input degraded image.

         otf is the optical transfer function. This represents the image
             degradation. It is also an fft the same size as in.

         otfout is the desired output optical transfer function.
                It is optional.

         out is the fft of the output image.

Note that WIENER has no SIZE parameter.  The output must be the same
size as the primary input, and the other input files must also be of
the same size.

METHOD
There are four options:

option=wiener (the default)
WIENER applies the Wiener noise additive restoration model on a point
by point basis:

        OUT(i,j) = IN(i,j) * W(i,j)

                        OTF"(i,j)
	W(i,j) = -----------------------
                 |OTF(i,j)|**2 + 1/SN**2

        OTF is normalized by dividing by the dc term.

option=direct
Wiener applies the OTF directly to the input:

        OUT(i,j)= IN(i,j) * OTF(i,j)

        OTF is normalized by dividing by the dc term.

option=ratio
Wiener constructs a transfer function from both inputs:
In this mode OTF is a focused image and IN is a blurred image.

                        X"(i,j)
        OUT(i,j) = -----------------------
                   |X(i,j)|**2 + 1/SN**2
 
        X(i,j)= IN(i,j)/OTF(i,j)

        IN and OTF are normalized by their dc terms

        Notice that no corrected image is produced. What you get is the
        fft of the restoring kernel. You may load a small piece into FILTER
        to restore the original image. If you use all of it you'll just
        reproduce OTF.

option=amplitude
Wiener constructs a transfer function from both inputs:
In this mode OTF is a focused image and IN is a blurred image.

        OUT(i,j)= IN(i,j) * W(i,j)

                        X(i,j)
        W(i,j) = -----------------------
                 |X(i,j)|**2 + 1/SN**2
 
        X(i,j)= | IN(i,j) | / | OTF(i,j) +.00001 |

        IN and OTF are normalized by their dc terms.

        Notice that W is real and symmetric so the convolving kernel will
        also be symmetric. This function cannot correct for phase.

where IN and OUT are the fourier transforms before and after restoration
respectively, W is the Wiener filter, OTF is the optical transfer function
(the fourier transform of the point spread function), OTF" is the complex
conjugate of OTF, and SN is the signal-to-noise ratio.

The optional third input is the fourier transform of the desired point
spread function of the output, OTFD.  If this is specified, then the
restored transform produced by the above processing is multiplied by
this:

  FT2(final,i,j) = FT2(i,j) * OTFD(i,j)

Normally one desires a delta function PSF, and OTFD is not specified.
HISTORY

  MAY-1985  ...LWK...  Original MIPL program, from combination of
			IBM programs RESTORE and GPFILT
  sep1990  ...lwk... removed NOPACK keyword because of replacement of
			MIPL program FT2 by FFT2AP  (code is still in
			place in case it's needed)
  JAN-1995 ...WH (CRI).. Made portable for UNIX

  Nov 1996 J Lorre  Added options
  
 Current Cognizant Programmer:  J Lorre


PARAMETERS:


INP

2-3 input filenames

OUT

Output filename

SN

Signal-to-noise ratio

OPTION

program mode

See Examples:


Cognizant Programmer: