Help for PSF
PURPOSE
Determine point spread function from image
OPERATION
This program copies a point spread function (PSF) contained in the
input image to an output image in a format suitable for the production
of the optical transfer function (OTF) by program "fft22". The
program was designed to be used in the procedure "restore", which deconvolves
the point spread function from an image, but can also be used in stand-
alone mode.
The input image is normally a star or the output of an appropriate test target
from a camera test.
The AREA parameter restricts where in the image the psf object occurs. For
example, if the PSF is from a starfield there may be other stars in the field
you wish to ignore. Similarly the output from a camera calibration test target
may have a border or other types of targets in the field.
EXECUTION FORMAT:
psf IN OUT SIZE AREA SHIFT
where: IN is the input image.
OUT is the output point spread function.
SIZE is the size of the output file, and should be
the same dimension as the image to which the
OTF will be applied.
AREA is a required parameter defining the location of
the point spread function in the input image.
SHIFT is an optional parameter determining whether the
PSF area will be allowed to shift in the input. SHIFT
is like what FFTFLIP does for FFTs.
METHOD
First, the program determines the mean of the DNs lying on the border
of the region defined by the AREA parameter. This mean is used as the
background DN value. The subimage of size determined by AREA minus the
background value is the PSF.
Next, the program determines the centroid of the PSF. The subimage is
quartered about the pixel closest to the centroid and is copied into
the four corners of the output data set. (This process is intended to
eliminate translation of an image when deconvolved with the point spread
function, although subpixel translations will still be present.) The
rest of the output file is left empty (0 DN).
The program works with BYTE, HALF, FULL and REAL formats. Its output
format is the same as the input.
It warns you if negative numbers are found in the image. If so, it
returns a value of 1 in the NEGATIVE return parameter.
RESTRICTIONS
For REAL images negative values are converted to 0. So centroid is
only computed from positive values. If it is important, you may convert
images with negative values to all positive by MAXMIN and F2 before
processing with PSF.
HISTORY:
Written by: J.J.Lorre, 1 Jan. 1978
Current Cognizant Programmer: Ray Bambery
Revisions:
1985-03-29 L.W.Kamp - Converted to VAX
1995-01-02 A.Scop (CRI) - Made portable for UNIX
2012-12-29 RJB - Fixes for 64-bit Linux under gfortran 4.7.2
2013-08-24 Ray Bambery - Fixed crash when used with BYTE images
Got message with BYTE images:
*** glibc detected *** /data/rjb/ada/src/psf: free(): invalid next size (fast): 0x00000000011deeb0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x36e8275916]
Program now accepts BYTE, HALF, FULL and REAL images
Added NEGATIVE return parameter.
2016-06-08 Walt Bunch - Migrated to MIPL.
PARAMETERS:
INP
Input image
OUT
Output PSF
SIZE
Size of output file.
= (SL,SS,NL,NS)
SL
Starting line
(always 1)
SS
Starting sample
(always 1)
NL
Number of Lines
NS
Number of samples
AREA
Area containing PSF.
SHIFT
Shift PSF about new
centroid?
NEGATIVE
A return parameter. If 1 then
negative numbers were found in
image.
See Examples:
Cognizant Programmer: