The securitylite program is designed to be run by cron automatically every 
night.  See security_cron_file for a an example cron command file.  The 
resulting data files are in a unique format (not movie, mpeg, etc) which is 
readable by the 'securityviewer' program - also in this directory.  Our goal
was to minimize the number of frames recorded without a person in them so we 
ignore gradual changes in lighting and we allow areas of the frame to be masked
off (see the -l, -r, -b, and -t options to do this.  The masking has two
effects, the first is that Areas of the scene which are of no interest can be
completely ignored.  An example of this is where we have a camera mounted on a
wall up near the ceiling.  Since most of the top of the frame is just a picture
of the ceiling, and we are not expecting spiderman, we just ignore that area of
the frame.  In our case this allowed us to solve another problem as well - Cars
driving by at night would shine their headlights on the ceiling and this caused
a "changed scene" condition which meant we had been recording a lot of frames 
of these headlight beams for no reason.  The -p and -c options affect the 
sensistivity of the movement detection process.  These need to be tweaked 
depending on what kind of camera is being used and how close the camera is to 
areas which are to be monitored.  In our case we originally had the -c option 
set to 20 which worked fine during daytime testing but we found that the low-
light camera we were using had a fair amount of variability when viewing a dark
scene.  In a completely unchanging scene some pixels would vary by 18 - 23 
brightness levels ( we are looking only at Black and White so the values range
from 0-255.  By bumping the -c option up to 25 we solved this problem.  The 
securityviewer program has a histogram option for determining how many pixels
change from frame to frame and by how much.  If you can't see why you are 
getting a bunch of frames, go to a section of the movie where there are not any
obvious changes and press the 'h' key and a histogram of the changes will be
printed.

Option flags:
-a hours    (number of hours to wait before recording starts)
-o hours    (number of hours to wait before recording stops)
-n          (Do not open graphical window)
-k          (Kill file output. No data file will be created)
-f filename (Filename of output file. default name built from system name and 
             date)
-p <value>  (How much change before pixel is counted as changed - default is 25)
-c <value>  (How many pixels must change before we write frame - default is 40)
-d <directory> (What directory should the file be put in as in -d "/security/")
-v <device> (Which video device. On an Indy use 0 for the IndyCam and 1 for 
             external video cam)
-b <value>  (Bottom clip value (479 is the very bottom of the screen) )
-t <value>  (Top clip value (0 is the very top of the screen) )
-l <value>  (Left clip value (0 is all the way to the left of the screen) )
-r <value>  (Right clip value (639 is all the way to the right of the screen) )
-s <value>  (Sleep time. Use 30 if you're using the system. Experiment with 
             value to find best mix of frame rate versus disk usage. )


Two new files were added 10/8/97.  They are 'getframes' and 'getminutes'.  The 
inspiration for these was having the burglar alarm company call up and say that
we had an alarm on the shipping/receiving door.  Unfortuntately, someone had been
working near the door and the data file was about 200 Meg.  To view this file from
my home over ISDN would have taken so long that it was not practical.  The getminutes
program takes a securitylite output file and copies out only frames that are less 
than n minutes old into a new data file called 'small'.  I can then view this file
and determine quickly if I really had a problem or if it was just an employee.
If you know that the problem happened in the last 10 minutes you can just type
'getminutes <filename> 10' and a new file 'small' will be created containing only
frames generated in the last 10 minutes.  If you don't know when it happened you
can run the program with just the filename as an argument and you will get a list
of 'minutes ago' numbers and date/time values and frame counts.  This should let 
you know what minute range you are interested in.  Typically though, if you are 
doing anything other than just getting the last 'n' minutes you probably want to 
use the 'getframes' program described next.

'getframes' is similar but instead of being based on time it is based on a frame 
count.  If you run it with just the data file name as an argument it will print
out a list of frame numbers showing when there was activity so you can pick a 
range of frame numbers you care about and then re-run the program with the file name,
start frame number, and stop frame number as arguments.  Again, the output will be
written to a file called 'small'.

