Help for REPAIR
REPAIR identifies bad lines (lines that are inconsistent with the
surrounding lines) and replaces them by interpolation of the nearest good
lines. If the locations of the bad lines or line segments are known, the user
may list the offending lines and use the ALL mode to repair just those lines.
If the locations of the bad lines are unknown, the program decides which lines
are bad by computing the interline correlation (and optionally the differences
in the means and the variances).
REPAIR can now repair multichannel data in BSQ or BIL organizations. All
channels are tested in aggregate, and if the line is found to be bad, the line
is replaced in all channels. No specific channel repairs are presently
implemented.
OPERATION
There are three modes of operation to REPAIR. The CORR and MV modes
differ only in the tests employed to determine bad lines, but the ALL mode
does no statistical testing, and is more closely related to the earlier VICAR
program SAR.
In the ALL mode, lines or regions are specified by the user via the AREA,
LINESET, BADLINE, and/or MODULO parameters. These regions are replaced by means
of a linear interpolation, using the lines immediately above and below the
region. Interpolation is performed in the line direction only, and the area
outside the specified regions is unchanged.
In the CORR and MV modes, the AREA, LINESET, BADLINE and MODULO
parameters are used to identify regions to be examined for bad lines. If all
three parameters are defaulted, the entire image is tested. Each line that is
to be checked is tested by the following procedure:
A. The line is compared to two reference lines: the last good line, and
the average of the next line and the last good line.
B. If the correlation coefficients between the test line and both of the
reference lines is less than the value of CORR, then the line is
considered bad. There is one exception to this test. If the ZOK (Zero
OK) keyword is in effect, lines that are all zeroes are passed as
good. The correlation coefficient is undefined for lines of constant
value, requiring this special case. A correlation coefficient of 0.0
is assigned to all other cases involving lines of constant DN.
C. If the MV (Mean and Variance) mode is in effect, then two additional
tests are employed. The test line is considered bad if its mean is
different than the means of the reference lines by more than the value
of MEAN, or if its variance is different than both the reference line
variances by more than the value of VARIANCE.
If a line is found to be bad, the entire line is replaced by a linear
interpolation of the last good line and the next good line.
This algorithm is fairly sensitive to the values of the CORR, MEAN, and
VARIANCE parameters. It may be necessary to run this program more than once
in order to find an appropriate set of values. In general, the CORR and
VARIANCE values provide the best tests for random noise and hashed lines. The
test of the means should only rarely be needed to reject a line.
The coordinates used in the AREA parameter (SL,SS,NL,NS,...) refer to the
input image, not the output image. This is important only if, in the size
field, the starting line or starting sample is not one.
The user should also be aware that if two regions specified by AREA,
LINESET, or BADLINE contain the same line, the two regions will be combined
into one larger region that contains both original regions. This can cause
problems, especially in the ALL mode, where more pixels may be modified than
were intended.
This program will run on byte, halfword, fullword, or real data. Up to
100 regions may by given by each of the AREA, LINESET, and BADLINE parameters.
If either MEAN or VARIANCE is not defaulted, the MV mode is automatically
used.
ORIGINAL PROGRAMMER: John Addington
CURRENT COGNIZANT PROGRAMMER: Ron Alley
REVISION: 14 January, 2003 (MODULO option added)
PARAMETERS:
INP
input data set
OUT
output data set
SIZE
output image window
(SL,SS,NL,NS)
SL
starting line
SS
starting sample
NL
number of lines
NS
number of samples
MODE
CORR, MV, or ALL
AREA
Sets of (SL,SS,NL,NS) to
be tested for bad lines
LINESET
Sets of lines to be tested
(SL,NL,SL,NL,...)
MODULO
Limit lines to those that
are N1 MODULO N2
BADLINE
Lines to be tested
CORR
Tolerance level for
interline correlation.
MEAN
Tolerance level for
difference in means.
VARIANCE
Tolerance level for
difference in variances.
ZOK
Are lines of Zero DN OK?
See Examples:
Cognizant Programmer: