           How to use "scalarize.c"
           ------------------------
        J. E. Boyd - UCSD - 21-Feb-97


Purpose:
--------

scalarize.c takes a series of optical flow images and computes scalars
based on the distribution of optical flow in the image.


Usage:
------

scalarize [command line switches]


-start <integer> (default = 0)
- stop <integer> (default = 5)  start and stop frame index for the sequence
			of flow images.

-    x <string> (default = <xout%03d.pgm>)
-    y <string> (default = <yout%03d.pgm>)
- mask <string> (default = <mask%03d.pgm>)  sprintf formats for generating
		the file names of the flow images, x-flow, y-flow, and
		validity mask.  The format takes a singel interger argument,
		the index of the frame.

-  out <string> (default = <out%03d.pgm>)  sprintf format for generating
		a series of output images.  These images are binary, white
		indicates valid flow above the motion threshold, black
		indicates no valid motion above the threshold.

-    v <on/off> (default = on)  use verified flow

- ymin <integer> (default =  10)
- ymax <integer> (default = 135)  top and bottom of a bounding box
		for the region to extract the scalar from.  This prevents
		spurious noise from the background afftection the result.

-xwidth <integer> (default = 40)  half width of the bounding box.

-xstart <integer> (default = 0)
-xstop <integer> (default = 5)  start and top positions of the bounding box


General:
--------

Input and output images are in pgm format.  Flow values are in 2s compliment
form (0 = 0, 127 = 127, 128 = -128, and 255 = -1 etc.).

If you don't want to exclude spurious background motion then just make
ymin, ymax, and xwidth very large.

"scalarize" writes the scalars to stdout.  Each line contains the scalars
for a single frame of flow.  The scalars appear on the line in the following
order:
   x_c  y_c  x_wc y_wc x_dc y_dc a_c a_wc a_dc x_uwc y_uwc x_vwc y_vwc

We used awk to separate a single scalar time series (a column of the
output of scalarize) for input to gnuplot and least-squares linear
prediction spectral analysis.


Notes:
------

jacobi.c and a number of other array allocatin routines are taken from
"Numberical Recipes in C".  I do not own the copyright to these so I cannot
distribute them.
