Help for GRIDLOCB

PURPOSE

	"gridlocb" locates the intersections of grid rulings in an image to
	sub-pixel accuracy.  The image is nominally a rectilinear grid
	network of horizontal and vertical rulings.  The primary use of
	the program is in the geometric calibration of vidicon (and possibly
	CCD) camera systems.

VICAR2 COMMAND LINE FORMAT

	gridlocb INP=(f.dat,tf.dat,marka.dat) OUT=markb NHOR=n NVER=m

  where...

      f.dat	is a version of the grid image, filtered to enhance the
		vertical grid rulings.
      tf.dat	is a transposed version of the grid image, filtered to
		enhance the horizontal grid rulings.
      marka.dat	contains nominal positions of each grid intersection,
                accurate to within 2 pixels.	    
      markb	will contain the final location of each intersection,
		accurate to within 0.1 pixel (more or less).
      n 	is the number of horizontal grid rulings in the image.
      m 	is the number of vertical grid rulings in the image.

  Both f.dat and tf.dat are input in 16-bit integer format (HALF).  marka.dat
  and markb contain (line,sample) pairs in REAL*4 format suitable for input
  to the program "mark".

OPERATION

	The imaged grid pattern is assumed to consist of dark (low dn)
	grid rulings on a light (high dn) background.  The grid pattern
	should be reasonably oriented in a vertical-horizontal direction,
	although small rotations may be tolerated.

	"gridlocb" requires, as input, two filtered versions of the imaged
	grid, and nominal locations of each intersection (accurate to 
	within 2 pixels).

	The first filtered version (f.dat) may be generated via "filter"
        using a	49x7 filter with identical weights 3,2,1,0,-1,-2,-3 for each
	line.  This filter will enhance the vertical grid rulings, such
	that pixels immediately to the left of each grid ruling are
	positive and pixels immediately to the right are negative.
	"gridlocb" will search for a zero DN value or a positive to negative
	transition along each line segment.  If a positive to negative
	transition is located, then the zero DN point is interpolated.
	Note that the filtered output has to be in 16-bit (HALF) format
	to preserve negative DN values.

	The second filtered version (tf.dat) is generated by first transposing
	the grid image (using "flot" with keyword TRANS) and applying the
	filter above to enhance the horizontal grid rulings.

	The nominal grid locations (marka.dat) may be generated via "gridloca",
	or "interloc", or "starcat".  "fixloc" may be used to correct or flag
	bad locations.

	"gridlocb" will locate the vertical and horizontal grid rulings by
	locating their zero-crossings at each point within a 7-pixel
	diameter of each nominal intersection (7 points are acquired in
	each direction).  A least squares fit is applied over these points
	to determine (local) equations for the vertical and horizontal
	lines.  The intersection is then solved for simultaneously.

	"gridlocb" will reject an intersection if its initial or final position
	is outside the image or if either vertical or horizontal grid
	rulings cannot be located.  Rejected intersections are flagged
	as (-99.0,-99.0).

EXAMPLE
	Let 'raw' be the raw version of the imaged grid target.  Filtered
	version f.dat may be generated as follows:
	
	filter raw f.dat 'HALF DNMIN=-32768 DNMAX=32767  	NLW=49 NSW=7 'NONSYM WEIGHTS=(  		3,2,1,0,-1,-2,-3, 		3,2,1,0,-1,-2,-3, 		  .   .   .  
		  .   .   .
		3,2,1,0,-1,-2,-3 )

	Filtered version tf.dat may be generated by running "flot",
		flot raw TRAN 'TRANS
	followed by the filter above.

	The generation of the input locations (marka.dat) is messy.  See
	"gridloca", "interloc", or "starcat".

	After running "gridlocb",
		gridlocb (f.dat,tf.dat,marka.dat) markb NHOR=20 NVER=21
	the resulting locations may be listed,
		fixloc markb NC=21
	or marked for display:
		mark (raw,markb) out
WRITTEN BY: Arnie Schwartz circa 1972

COGNIZANT PROGRAMMER:  Gary Yagi

REVISION HISTORY:
  13 Apr 1998   R. Patel     Modified tst pdf to include correct path
                             for test data.
  14 Jul 1997   R. Dudley       Added new label items for grid size.
  8  May 1995   V. Unruh ... (CRI) Made portable for UNIX
  28 Aug 1987	G.M. Yagi	Use array I/O.  Replace FORTRAN77 with GOTO.
  circa  1985   D. Meyers	VAX conversion.  Rewritten in FORTRAN77.


PARAMETERS:


INP

INP=(f.dat,tf.dat,marka.dat) where f.dat and tf.dat are the filtered and transposed+filtered grid targets and marka.dat are the nominal locations of each grid intersection.

OUT

Output will contain the located grid intersections as (line,sample) pairs.

NHOR

Number of horizontal grid rulings.

NVER

Number of vertical grid rulings. .END

See Examples:


Cognizant Programmer: