Help for GEOMZ
PURPOSE:
Program "geomz" is a VICAR applications program which is used to
perform vertical (brightness or DN) correction of images by a set of
points specified as parameters or in a parameter data set.
"geomz" does not perform a geometric transformation (of line and sample
coordinates) of the image.
EXECUTION:
"geomz" is designed to be an analog of program "GEOMA". Its application is
for vertical (brightness or DN) manipulations of images. Vertical corrections
are specified by the user through tiepoints either as parameters or in a
parameter file. (Program "TIECONM" can produce a parameter file for "geomz".)
The "GEOMA" execution format has been imitated as closely as possible.
The size of the output image is determined by the number of lines and number
of samples in the SIZE field if the SIZE field is entered by the user. If the
SIZE field is not entered, the output file is the same size as the input file.
The data type of the input image may either be byte or halfword data.
The data type is obtained from the VICAR label of the input image.
The output image has the same data format (byte or halfword) as the input
image.
TAE COMMAND LINE FORMAT
The following command line formats show the major allowable forms:
geomz INP=a OUT=b SIZE=(sl,ss,nl,ns) parameters
geomz INP=a OUT=b SL=sl SS=ss NL=nl NS=ns parameters
geomz a b (sl,ss,nl,ns) parameters
geomz a b parameters
geomz INP=a OUT=b SIZE=(sl,ss,nl,ns) PARMS=c optional parameters
geomz INP=a OUT=b SL=sl SS=ss NL=nl NS=ns PARMS=c optional parameters
geomz a b (sl,ss,nl,ns) PARMS=c optional parameters
geomz a b PARMS=c optional parameters
Here 'a' represents the input image file name,
'b' represents the output image file name,
and 'c' represents the parameter file name.
The tiepoint grid must be specified as as set of parameters either in the
TAE command line or in the parameter file.
The tiepoint grid is specified using the parameters NAH, NAV, and TIEPOINT.
NAH=nah NAV=nav TIEPOINT=( L1,S1,DZ1 L2,S2,DZ2 ... )
nah is the number of grid cells horizontally (across the top in the sample
direction), nav is the number of grid cells vertically. The grid must be
evenly-spaced and perfectly rectangular and the rows and columns must be
perfectly horizontal and vertical respectively.
EXAMPLE
geomz INP=A OUT=B SIZE=(1,1,500,1000) NAH=1 NAV=1 FIXVAL=0 TIEPOINT=( 1,1,10 1,1000, -10 500,1,10 500,1000, -10 )
This example cause the input to be changed by a ramp function with the
leftmost pixels becoming 10 DN brighter and the rightmost pixels becoming
10 DN dimmer. Pixels with a 0 value in A are not changed because of the
FIXVAL parameter.
RESTRICTIONS
1. The input and output images must be byte or halfword data.
2. The maximum number of pixels per line is 60,000.
3. The maximum number of tiepoints is 40,000. (If parameters are used
instead of a parameter file, the limit is 200.)
4. The maximum value for NAH is 200.
5. The maximum value for NAV is 3000
OPERATION:
The input picture is transformed pixel by pixel to the output picture by
adjusting the DN value according to nearby tiepoints. A four (NAH) by
three (NAV) tiepoint grid is illustrated below. The tiepoints are marked
with a '+' character. The lines show how areas are defined by the grid.
A pixel within an area is adjusted according to the four tiepoints that
define the area containing that pixel. Usually, this is a rectangle
containing the pixel; but if the point lies outside the convex hull of the
grid, then the nearest rectangle is used for adjustment.
| | |
+ + + + | | |
------+------+------+------+------+------
| | |
------+------+------+------+------+------
| | |
+ + + + | | |
The DN adjustment is obtained by bilinear interpolation (or extrapolation)
of the adjustment at the four grid points. The formula is
DN (output) = DN (input) + ax + by + cxy + d
where x and y are the pixel coordinates and a,b,c,d are constants chosen
so that
delta DN(k) = ax(k) + by(k) + cx(k)y(k) + d for k = 1,2,3,4,
where x(k) and y(k) are the coordinate values and delta DN(k) are the DN
shifts of the four selected tiepoints for the point x,y.
The calculation is performed by a double incrementing scheme. For a single
line, the DN increment per pixel is given by b+cx. The starting values for
subsequent lines are incremented by a+cy. Thus the full solution is needed
only at the upper left corner of an area, and all other values are obtained
by incrementing.
After the delta-DN (DZ) values are added, the resulting DNs are then checked
for being valid for the data type (byte or halfword) of the image and are
adjusted if invalid. For byte data, DNs less than 0 are set to 0, and DNs
greater than 255 are set to 255. For halfword data, DNs less than 0 are set to
0, and DNs greater than 32767 are set to 32767.
WRITTEN BY: Steve Pohorsky 1 May 1986
Original Programmer: H. Wilczynski 1 Sep 1977
Cognizant Programmer: Steve Pohorsky 1 May 1986
Made portable for UNIX VRU (CRI) 8 May 1995
PARAMETERS:
INP
Input file name
OUT
Output file name
SIZE
Standard VICAR Size Field
SL
Starting line for output
SS
Starting sample for output
NL
Number of lines for output
NS
Number of samples for output
NAH
number of grid
cells horizontally
NAV
number of grid
cells vertically
TIEPOINT
grid corner tiepoints in
rows L1,S1,DZ1,L2,...
FIXVAL
a single DN value (optional)
to be left unchanged by the
DN transformation.
PARMS
optional parameter file
See Examples:
Cognizant Programmer: