NAME
	fv.pl - Automates generation of training and test sets

SYNOPSIS
	fv.pl

DESCRIPTION
	This program can automate the generation of training and test sets
for use with nn.pl and neural networks given a set of properly named source
images. Configuration options can be found by opening in clear text the program
file and finding the "# Configuration" section at the top, which contains the
following options:
	train	Must be from 0 to 1, percentage of images which will be devoted
		to the training set
	i_dir	Directory to find the input images
	o_dir	Directory to output the test and training vector files
Images are expected to be named according to a certain format, and the program
will quit with an error if it finds any that do not match the format within the
directory. It accepts GIF image files only that must be named:
	(f|r)[a-z]\d{3}.gif
The first field, (f|r), specifies whether the image is a fake or real
(authentic). The second field, [a-z], designates the set of images which the
file belongs to, which allows for multiple different sets of images to exist
within the same directory. This field should start with a and count up to z,
though this labelling scheme is not required. The third field, \d{3}, notes
the image number. The last field, .gif, specifies that the file is a GIF file.
Example:
	fa001.gif	1st fake image from set a
	rb004.gif	4th real image from set b
	Sets a & b are unrelated, and order does not matter so long as all
	numbers for any given combination of (f|r) and [a-z] count from 001-999.
The script will dump the results into files in the o_dir named as follows:
	o_dir/test0
	o_dir/train0
	o_dir/test1
	o_dir/train1
	...
The number at the end designates the set that the test and training set belongs
to and is calculated by the set's character value, as specified in the source
image files, difference from the character 'a'. Thus, 'a' has value 0, 'b' 1,
etc. This program will wipe all previous test and training sets located in the
o_dir directory! It also executes some preprocessing on the source image files,
which are left in the same directory as the source images and named as
[source image file].vx. Namely, it
	converts the image file from GIF to VX
	performs a median filter to reduce noise
	thins the image to obtain skeleton
	prunes the image with n=20 to reduce surface noise
	extracts the bounding box
If the vx files already exist, it does not repeat the process in subsequent 
runs. After preprocessing, it calls on "feature" to extract the feature
vector. The feature vector can be substituted as long as the new feature
program obeys the same interface as the old (namely, of= and t=). It expects
a file "init.setup", which will be sourced, to setup paths to other program
files needed.

CONSTRAINTS
	Perl must be located at /usr/local/bin/perl
	Files needed: init.setup, source image files
	Programs needed: bb, vformat, vfix, vmedian, v3thin, v3prune, vpix,
		feature

OPTIONS
	None

AUTHOR(S)
	U.Moszkowicz and A.Mehler
