Help for MEDIAN
PURPOSE:
MEDIAN is a VICAR applications program which performs nonlinear spatial
filtering of an image based upon the local (rectangular window) median or
percentile rank of the input. Output may be in either lowpass or highpass form.
EXECUTION:
MEDIAN may be executed in the following manner:
MEDIAN INP=A OUT=B SIZE=(SL,SS,NL,NS) PARAMS
where INP, OUT, SIZE, AND PARAMS are parameters and are explained in their
respective parameter section.
OPERATION:
MEDIAN finds the local median value of a rectangular window centered at
each pixel by accumulating a histogram of all contained pixels. This
histogram could be interrogated for three basic statistical quantities:
mean, mode, and median. The mean is the average value in the histogram, the
mode is the most frequently occurring value in the histogram, and the median
is the value which equally divides the population of the histogram.
The output value of MEDIAN may be modified by the inclusion of the PERCENT
keyword. For example, PERCENT=25.0 will output the value which has 25% of
the window pixels less than it, and 75% of the window pixels greater than it.
If HIGHPASS is specified, the final output is given as:
OUT = IN - MEDIAN + DCLEVEL + DCTRAN*IN
BIBLIOGRAPHY:
Huang, Yang, and Tang, "A Fast Two-Dimensional Median Filtering Algorithm,"
IEEE Trans., Vol. ASSP-27, No. 1, February 1979.
EXAMPLES:
1) MEDIAN INP=A OUT=B NLW=5 NSW=7
This example performs the lowpass median filter of size 5 lines
by 7 samples.
2) MEDIAN INP=A OUT=B 'HIGH NLW=3 NSW=3
This example performs the highpass median filter of size
3x3 pixels.
3) MEDIAN INP=A OUT=B PERCENT=20 NLW=7 NSW=9
This example outputs a value corresponding to the 20% level
of a histogram generated by a 7 line by 9 sample filter. The
output is then the 12th lowest value in the local window
rather than the 31st lowest value (50% level).
HISTORY:
ORIGINALLY WRITTEN BY: W. D. Benton, 27 November 1978
REWRITTEN WITH FASTER ALGORITHM BY: H. J. Frieden, 22 July 1980
CONVERTED TO VAX BY: Helen De Rueda, 30 Nov. 1983
REWRITTEN TO PERMIT NON-BYTE DATA: Ron Alley, 4 Dec 1991
COGNIZANT PROGRAMMER: Ron Alley
PARAMETERS:
INP
input dataset.
OUT
output dataset.
SIZE
VICAR size field,
(SL,SS,NL,NS).
SL
starting line to be output
SS
first sample to be output
NL
number of lines
NS
Number of samples
NLW
Size of filter in lines
NSW
Size of filter in samples
HIGHPASS
KEYWORD-Highpass option.
DCLEVEL
Offset to be added to
highpass output.
PERCENT
Output value percentile
DCTRAN
DCTRAN*Local Median is
added to the highpass output.
See Examples:
Cognizant Programmer: