Help for ZFILL
PURPOSE:
ZFILL uses a window of NLW lines by NSW samples to fill in void areas
of an image. Void areas are assumed to be zero DN, but can be respecified
by parameter. Voids are filled with the mean value of all 'non-void DN'
pixels in the window. A mask showing filled pixels can be generated on
request.
The user can select between two algorithms in ZFILL. The results of the
algorithms are identical, but computation times vary dramatically. The
'sparse' algorithm is faster if the input image is mostly empty; the 'dense'
algorithm is faster if the input image is mostly complete.
EXECUTION:
Examples
ZFILL A B 'DENSE
This command will use the default window (3 by 3) to scan
input image A for pixels with value 0. For each such pixel,
the average of the surrounding pixels will be calculated, and
substituted for the original value. The 'dense' algorithm has
been chosen, for the input has only a few 0 values to be replaced.
ZFILL A B REPL=10 EXCL=8
This command will use the default window (3 by 3) to scan
input image A for pixels with value 10. For each such pixel,
the average of the surrounding pixels (excluding those valued 8)
will be calculated, and substituted for the original value.
ZFILL A (B,MSK) NLW=2 NSW=5
This command will scan image A for occurrences of 0-valued pixels
(zero is the default value for replacement). These will again
be replaced by the averages of the surrounding values. Note
the window size which is specified to be 2 by 5. Even dimensions
are automatically increased to the next odd integer, so the
window size which will be actually used is NLW=3, NSW=5.
Note that the command above produces an mask showing which
pixels were changed; mask pixels have DN 0 if they were changed
in the output image, and 255 otherwise.
OPERATION:
ZFILL contains two algorithms. In the 'sparse' (default) mode, the
data lines needed for the window of the first pixel are read in and averaged;
after this point, as the window moves across the image, the left (and top)
values which move out of the window are subtracted from the accumulating
variables, and the new pixels appearing at the bottom and right of the window
are added in. Any time a pixel needs to be replaced, the average may be
easily calculated from these variables.
In the 'dense' mode, pixels are checked for replacement first; the
replacement value is computed only if needed. The entire window must be
examined to compute the replacement value each time a pixel is replaced.
As a rule of thumb, the default (sparse) algorithm is faster if the
fraction of pixels to be replaced is more than 2/NSW. The 'dense' algorithm
is faster otherwise.
When the filling window extends beyond the image (not image window)
boundaries, the outside pixels are treated as excluded values.
WRITTEN BY: S. Z. Friedman, March 1983
COGNIZANT PROGRAMMER: Ron Alley
REVISION: 1 20 May 1986
PARAMETERS:
INP
Input image file
OUT
Output image file(s)
SIZE
Standard VICAR size field
SL
Starting line
SS
Starting sample
NS
Number of lines
NL
Number of samples
NLW
Window length (lines)
NSW
Window width (samples)
REPLACE
DN value to replace
EXCLUDE
DN value to exclude
MODE
Valid: SPARSE, DENSE
See Examples:
Cognizant Programmer: