Help for FILTER
PURPOSE:
FILTER is a VICAR applications program which performs two-dimensional
convolution filtering. For each output sample, the program computes
a weighted average of a rectangular set of input pixels followed by
a linear transformation. FILTER may be used to perform high-pass or
low-pass filtering.
EXECUTION:
The following is the execution statement format for FILTER:
FILTER INP=PIX OUT=OPIX PARAMS
where INP, OUT, and PARAMS are parameters discussed in their res-
pective parameter sections.
OPERATION:
FILTER accepts as input a rectangular set of weights and calculates each
output point OUT(l,s) as follows:
_ _
| nlw nsw | /
XXX(l,s) = | SUM SUM IN[l-(nlw+1)/2 + i , s-(nsw+1)/2 + j] * W(i,j) | / DIV
|_ i=1 j=1 _| /
and
OUT(l,s) = (GAIN * XXX(l,s)) + OFF
where
IN is the input file
W is the weight matrix
nlw is the number of lines in the weight matrix
nsw is the number of samples in the weight matrix
OFF,GAIN are the SCALE parameters
DIV is the DIVIDE parameter
EXAMPLES:
1) FILTER IN OUT NLW=3 NSW=5 WEIGHTS=(0,-1,-2,-1,-2,10)
The file will be filtered with the weight table shown below:
0 -1 -2 -1 0
-1 -2 10 -2 -1
0 -1 -2 -1 0
The final linear transformation is
FP(L,S) = IN(L,S) / 6
where 6 is the default for the DIVIDE parameter, (i.e., the sum of the
entries in the weight table).
2) FILTER IN OUT NLW=3 NSW=5 SCALE=(-30,1) DIVIDE=3 WEIGHTS=(0,-1,-2,-1,-2,10)
This is the same as the example above except the final transformation is
given by:
FP(L,S) = 1.0*(IN(L,S)/3.0) -30.0
3) FILTER IN OUT NLW=3 NSW=5 'UPPER DNMIN=15 WEIGHTS=(-2,5,4,3,-1,-5,20,3,1,1)
These parameters generate the horizontally nonsymmetric weights shown
below:
-2 5 4 3 -1
-5 20 3 1 1
-2 5 4 3 -1
and output will be computed as follows: If the output is less
than or equal to 15 DN, it is set to 15 DN.
4) FILTER IN OUT NLW=3 NSW=3 'ALL WEIGHTS=(-1,0,0,0,0,0,0,0,1)
These parmeters will produce a diagonal gradient picture using this weight
matrix:
-1 0 0
0 0 0
0 0 1
5) FILTER (IN,KERNAL) OUT
In this case, the filter weights are provided in the second input file.
COGNIZANT PROGRAMMER: Ron Alley
PARAMETERS:
INP
1. Input image file
2. (Optional) Weights as a
VICAR image file
OUT
Filtered image file
SIZE
Vicar size field
SL
Size field starting line
SS
Size field starting sample
NL
Size field number of lines
NS
Size field number of samples
NLW
Number of lines of weights
NSW
Number of samples of weights
SYMM
WEIGHTS are what part of the
weights matrix? Valid:
UL - for upper left quadrant
UPPER - for upper half
LEFT - for left side
ALL - for entire matrix
WEIGHTS
Defines the weight matrix
DIVIDE
Scaling paramater upon output
SCALE
Linear output scaling:
(offset,scale)
DNMAX
Defines maximum output dn
DNMIN
Defines minimum output dn
RANGE
DN interval to which output
will be clipped.
(Synonym for DNMAX,DNMIN)
EDGE
Method of handling edges
REFLECT, CYCLE, LCYCLE, SCYCLE
PARMS
Parameter data set name
See Examples:
Cognizant Programmer: