--------------------------------------------------------------------------------

This file was created on Wed Oct  4 15:40:53 GMT 2000 by nts.

-------------------------------------------------------------------------------

Program: The Leeds/Reading People Tracker

--------------------------------------------------------------------------------

Revision 0.0.99pre1 for Linux2: nts, Mon Oct  9 17:41:50 GMT 2000

All previous RCS directories and data put into old-RCS-data.tar.bz2 after
checking in all files still checked out.

All changes made from now on will be in CVS, not RCS, starting with version 0.1
after some general, global changes in all source files (as applicable)
described only here:-

* main clean-up for files/directories: chmod a-x for non-executables, clean up old
  auto-save files, remove a few spelling mistakes.

* changed Adam Baumberg's copyright notice to the one David Hogg (University of
  Leeds) has sent per e-mail some time ago.  This is in accordance with
  regulations at the University of Leeds after which the Code is in fact
  copyright University of Leeds, not copyright Adam Baumberg.

* removed Adam Baumberg's initials, "Amb", from filenames
  (utils/AmbErrorHandler.h and utils/AmbErrorHandler.cc), class names
  (AmbGlobals and AmbErrorHandler) and environment variables (AMB_QUIET_MODE,
  AMB_EXIT_ON_ERROR in ErrorHandler.cc: replaced AMB with LPT temporarily)

* restored regions/Linux2/Makefile from regions/Linux2/Makefile.bak
  and progs/Linux2/Makefile from progs/Linux2/Makefile.bak

* in progs/ground_track.cc, progs/ground_track2.cc and
  progs/viz_tracking_results.cc: #ifdef LINUX we use moviestore.h and not
  sgmoviestore.h which also changes the instantiation of MovieStore (another
  #ifdef); also in imgsrc/Linux2/Makefile we include moviesrc.h imgsrc.h in
  HDRS1 and moviestore.cc in SRCS1 for compilation so MovieStore is in libis.a.

LIBRARIES AND SOURCE COMPILE when used with -g option for compiler.

PROBLEMS REMAINING:

* cannot display b/w motion images ("Ygl: cpack: not in RGB mode.")

* output (display) is polygons instead if b-splines.  Also, spurious control
  points are displayed.

* have not started using CVS.

--------------------------------------------------------------------------------

Revision 0.0.99pre2 for Linux2: nts on Tue Oct 10 15:58:07 GMT 2000

changed generic.mk for use with CVS (variables SRC_HOME and TMP_HOME point to
directory advisor own home directory now).

CVS will now be used.

CVS calls this revision 0.0.99pre2 revision 0.1.  Whatever.

--------------------------------------------------------------------------------

Revision 0.2 for Linux2: nts on Wed Nov  8 15:58:01 GMT 2000

#ifndef LINUX around use of variables IA_B_TO_T and IMAGE_VIDEO as they are
SGI-specific (files changed are in imgsrc/).  This means NO environment
variables need to be set in order to run the tracker on a Linux platform.
Note: we could re-enable it and default to bottom-to-top if we needed it.

Completely new imgsrc/moviestore.* (class MovieStore) for JPEG export (numbered
image files) of tracked sequence etc, using the Independent JPEG Group's
libjpeg (version 6b).  Un-commented output_movie (-o parameter in executables)
and demo_movie.  For Linux, we use the new MovieStore class from moviestore.h
instead of the SGI "MOVI" file format MovieStore class from sgmoviestore.h.
 
In utils/GlobalsManager.cc: added check not to print out empty strings (NULL)
to saved parameter file (in GlobalsManager::dump_parameters (ostream&
output_stream).  The problem was that these empty strings could not be read in
again by using the -p parameter to executables.

Added defines -DLSB_FIRST or -DMSB_FIRST to generic.mk to use it in
imgsrc/RGB32Image.* (especially in definition of struct RGB32pixel because this
struct is often circumvented in The Code).  Changed LITTLE_ENDIAN_ARCHITECTURE
define test in imgsrc/RGB32Image.cc (unused since undefined).

Added a -DMONOCHROME_8BIT define to use an 8-bit grey-level image instead of a
1-bit BWImage as the motion image (only change in RGB32Image::simple_difference).
This fixes the problem with displaying the motion image when compiling on Linux
(using Ygl; maybe that's the reason we couldn't display the BWImage).

Completely new imgsrc/JPEGSource.* (an ImageSource class) for JPEG input
(numbered images), using the Independent JPEG Group's libjpeg (version 6b).
JPEGSource.cc revision 1.0: working with full colour images, JPEGSource.cc
revision 1.1: preliminary (?) support for grey level images, solely intended
for reading originally black/white motion detector output JPEG images (JPEG
mode JCS_GRAY) given to us by INRIA.

Added support for external motion image source (-i motionfile=... parameter) in
imgsrc/imgsrc_utils.* and tracking/MotionDetector.*. If specified, it means we
don't calculate motion images (spatially median-filtered, thresholded
difference video input - background image) any more.  This does not
automatically disable temporally median-filtered background image generation
because we need that for foreground edge detection.

Changed imgsrc/PgmSource.* to adhere to PNM standard.  Formats supported now
are the raw formats P5 (PGM, 8-bit grey) and P6 (PPM, 24-bit RGB colour), as
well as these formats, compressed by compress(1) or gzip(1), using a zcat pipe
to decompress these.

Checked usage of initial background ("reference") image, allowed for it to be
either JPEG or a format recognised by the new PgmSource (see above).  Added
warning if we cannot open the image, even the one defaulted to.

Removed environment parameter DISPLAY_GRAYS from imgsrc/Gray8Image.cc which
reduces the number of grey levels displayed when using GL to 128.  I see no
problem with our GL (Ygl) so we might as well display all 256 grey levels.

Made some functions inline and some variables register for speed.  Several other
small optimisations for speed wherever I saw something slow...

In imgsrc/image.cc: commented out getdisplaymode() testing every time a colour
is set in RGBcolor() --- too slow.
NOTE: This means we are assuming we have an RGB (or even TrueColour?) display.

Changed the way colours for displaying lines/markings in the image are
calculated (they are not any more).  Now there is a simple lookup table
(draw_colour_table) in imgsrc/image.h where you can define the colours (R/G/B)
to be used.  Calls to set_color() still simply give a colour number, now an
index to that table.

Changed PipeSource::recalc() not to give an error message any more if not
redefined by derived classes.  It should return a reasonable default result now.

Changed the -Dgl_interface define to -DUSE_GL to have all-uppercase defines.

utils/realno.h and imgsrc/realno.h only had one small difference, so I removed
the latter.

removed imgsrc/delay.h because it is not used.

Several small changes, like changed default value of SHOW_MOTION_IMAGES to true,
changed a few 256's to 255 (used to convert a 0..1 float to pixel value),
changed spelling heirarch* -> hierarch* in tracking/ActiveModel.*,
changed a few local variable names so they have more interesting names (x,y not i,j)

--------------------------------------------------------------------------------

Revision 0.3 for Linux2: nts on Thu Jan 18 15:11:30 GMT 2001

In utils/name_mangle.{h,cc}: added optional bool gobble_number flag to
name_mangle numbered files correctly: removing trailing [_.-]*[:digit:]* from
name base.  name_mangle("camera38_0073.jpg",".reference",true) will give
"camera38.reference").

Completely new program progs/video_play.cc which simply plays back a video
sequence.  Can possibly store sequence using a moviestore class (not tested).

changed most (all?) abort()s to exit(1)s, giving some error information on
stderr to tell the user where the error has occurred.

added necessary .cvsignore files to ignore temporary files like .depend

renamed global filename variable "GP POINTS" to "GP_POINTS" in
tracking/GroundPlaneToImagePlane.cc

removed file progs/ground_track2.cc (in fact, made the one change necessary to
get ground_track.cc from ground_track2.cc to the first).

added initial skeleton files xml/XMLSource.{cc,h} and xml/XMLInit.{cc,h} as
well as xml/DOMTreeErrorReporter.{cc,h} to implement XML input and output.
Also, changed imgsrc/imgsrc_utils.{cc,h} to accept new input option xmlfile=...
for use by XML input module.  The option is set up by get_live_or_movie_feed().
The new global boolean variable use_external_motion_regions tells us whether we
use this new input source, and the existing variable use_external_motion has
been renamed to use_external_motion_images to clarify the difference.
external_motion_source is now called external_motion_images_source.

Small changes to tracking/MotionDetector.cc to reflect the new name of the
boolean variable use_external_motion_images and to disable displaying of
(non-existent) difference images when using an external motion image source.

"rm" and "cvs remove" source/imgsrc/csgo/* source/imgsrc/csgo because we do not
need them.

Small bugfix to imgsrc/JPEGSource.cc in the constructor to fix problem of
undefined variable JPEGydim after constructor is called.

In tracking/MotionDetector.cc: Added parameter file option
SHOW_BACKGROUND_IMAGES to determine whether the generated background
(reference) images should be displayed.  Default value: true.

In progs/ground_track.cc: Added parameter file option SHOW_CAMERA_VIEW to
determine whether the synthetic camera view (tracked people on black
background) should be displayed.  Default value: false.

Added endl in output of tracked profile to stream.

In tracking/FeatureDetector.cc, imgsrc/GrayMap.{cc,h} etc: changed another few
256's to 255 (used to convert a 0..1 float to pixel value)

--------------------------------------------------------------------------------

Revision 0.4 for Linux2: qxw on Thu Mar 8 14:40:27 GMT 2001

Written four new classes, XMLSource, XMLHeader, XMLSequence, and XMLBlob, and 
other associated data structures, as well as their implementations in two new 
files: xml/XMLSource.h and xml/XMLSource.cc. The software is used for decoding
XML data for Motion Detection results from INRIA.

Added two overloaded methods in RegionSet class (in region/RegionSet.h and 
region/RegionSet.cc): grab_regions() and grab_all_regions(). These are two key
routines to handle the interfacing between INRIA's XML Motion Detection result 
and our people tracker. 

Written xml/Makefile (new) and xml/Linux2/Makefile (new) and Modified 
source/Makefile for compiling the new XML related
classes.

--------------------------------------------------------------------------------

BRANCH 0.3.2.1 tagged new_concept, based on Revision 0.3 (nts).

Conceptual changes:

Changes to pre-calculate difference image and experiment with filters on this
difference image.  Some name changes to images etc that were called difference
but were actually thresholded and sometimes filtered, already.

Example:
Renamed DifferenceSource to ThresholdedDifferenceSource because it thresholds,
created DifferenceSource which doesn't.
Overloaded Image::difference() to use non-thresholding routine when called
without threshold parameter.  Implemented new difference() for RGB32Image to
separate differencing from thresholding.

Added ColourFilter PipeSource class and ImageSource method to RGB32Image (and
virtual to image), uses enum ColourFilteringMethod to determine requested
filtering method.


Other changes:

Completely changed progs/data_extraction which is used to extract people shapes
from video sequences, for building PCA models from the output.  Program is now
interactive, allowing the user to change motion detection threshold and other
parameters (like dilation) before accepting or discarding shapes detected in
current frame.

Added program progs/convert_model to convert PCA model files that have binary 
NAG output (which is platform dependent because of byte ordering) and convert
the model file to a portable ASCII version.  It will be read just as the binary
version because NAG routines accept both binary and ASCII input, but it can be
used on any byte order machines.

Changed default value of variable EnvParameter output_binary_mode
("NAG_BINARY_OUTPUT") to false to avoid byte ordering problems in the future.
Set to true if you really want to save a 9kB disk space or gain 2 msec because
of faster reading of the file (done once only, at program start).

Changed program progs/process_sequence and the used classes in
ProfileSequence.cc and regions.{cc,h} to display PCA modes (shapes)
correctly.  The displaying was not working since we had ported from SGI.

Changed our thread handling to be POSIX 1003.1c compliant.

#ifdef USE_CAR_DATA around some car tracking stuff we do not need.

removed source/scripts/ subdirectory and all files in it (my temporary data)

moved variable debug_level (DEBUG_LEVEL in config file) into {Simple,Ground}\
PeopleTracker, declared extern wherever we need it, so we can use it globally.

changed ALL spellings of gray to grey except where libraries need it

More debug output/visualisation when debugging (-DDEBUG) with debug_level == 1.

several small optimisations and removal of unnecessary lines of Code

Frame numbers in imgsrc/JPEGSource.cc were wrong in some cases.  Fix.

--------------------------------------------------------------------------------

Revision 0.5 for Linux2: nts on Thu Mar  8 20:16:46 GMT 2001

Merged in branch new_concept (Rev 0.3.2.1), changes as above.

--------------------------------------------------------------------------------

Revision 0.6 for Linux2: nts on Wed Jun 13 14:32:54 BST 2001

MAJOR CHANGES:

Created new tracking class HumanFeatureTracker to track features such as
heads etc.  Created program feature_track to test and run the new tracker.
Implementation of head detection more or less finished, but no tracking
yet.

MEDIUM TO MINOR CHANGES:

Enabled use of XMLSource and XMLSequence for motion region data input from XML
file, in MotionDetector.

Synchronised frame numbers of XML input and PPM/JPEG input (in MotionDetector).
Fixed frame number output in ground_track and threw it out of
WorldOcclusionHandler.

Changed default average world height from 1800 (mm) to 180 (cm) as we now have
to use cm as length unit.  Also, changing default values for SD in real world
coordinates appropriately (ie, to mm).  (adjustments to GroundPeopleTracker)

Small changes to progs/calibrate_ground_plane.cc (slight improvement to user
interface).

removed unused template files source/xml/XMLInit.{h,cc}.

Small fix to XMLSource.cc (wrote something to the wrong stream).  Also, now all
debug and error output goes to cerr not cout so we can direct output somewhere.

started implementing some debug movie output (motion images and difference) in
MotionDetector.cc,  la ActiveModel.cc .  NOT FINISHED.

Added an ostream& operator<< for an RGB32pixel in RGB32image.{cc,h} which
writes (r,g,b) as a decimal triplet.

Made red, green and blue members of RGB32pixel unsigned char as they should be;
changed image differencing Code accordingly.

Changed edge detectors in FeatureDetector.{cc,h}, especially colour foreground
ones to a) use pre-calculated difference image properly and b) do some more
logical edge detection.  This increased performance for our edge detection with
colour images.

Changed names of edge detector classes which contained the string
"FeatureDetector" to the equivalent name with "EdgeDetector" as this is exactly
what they do, edge detection.  This makes class names more consistent.

Made some members private in MotionDetector and created access functions to get
the data (=> changes to tracking/*PeopleTracker.cc).

Renamed method MotionDetector::process_next_frame() which processes the first
frame, to process_first_frame().  (=> changes to tracking/*PeopleTracker.cc)

Added support in MotionDetector for an additional, constant motion mask to keep
pixels containing digits from time overlays etc from being considered during
mo/detec.  The mask will be read from a PGM file given in the main dialog box,
or in the parameter file (variable ADDITIONAL_MOTION_MASK).  Use black (0x00)
in the image to mask out a pixel/area, white (0xff) to leave pixel untouched.
(These correspond to the const unsigned chars MARK and CLEAR_MARK in the
source.)

Delete newly created image on error in pnm_read().  We return NULL, anyway.

Enabled profiling by adding option to use the -pg option for the compiler, in
generic.mk.  Wrote comments to explain how to obtain the profiling data, in
generic.mk.

Removed imgsrc/EnvParameter.h because it also exists in and belongs into utils/ .

New Image class HSV32Image, derived from RGB32Image, to store HSV images as
calculated with an algorithm after D Travis.  See imgsrc/HSV32Image.{h,cc}.

--------------------------------------------------------------------------------

New revision numbering necessary because CVS assumed revision 1.0 not 0.1 for
new files.  To keep CVS happy, I call the next revision 1.7 not 0.7  --- nts.

--------------------------------------------------------------------------------

Revision 1.7 for Linux2: nts on Wed Aug  8 19:40:50 BST 2001

// This version also incorporates all changes done by Rmi Belin (marked
// `(rb)', work supervised by nts) and some changes by Philip Elliott (marked
// `(pte)', work supervised by nts).
// All other changes (not marked) by nts.

MAJOR CHANGES:

Removed many files in imgsrc (and references to them elsewhere) to:-

  * drop support for any other input image file format than JPEG, PNM and MPEG,
  * discontinue use and support of BWImage class (use Grey8Image), RGB8 and YUV
    images.

Edited some files and removed some in order to:-

  * drop support for any other platform than Linux on x86,
  * remove support for interfacing with the car tracker (had not been used for
    years and might not have worked, anyway).


Added a new tracker, SkeletonTracker, which uses a skeleton-like structure to
trace a person in the image.  Uses HumanFeatureTracker output for
initialisation.


(rb) Added XMLWriter class to write out tracking results in XML form according
to XML Schema "http://www.cvg.cs.reading.ac.uk/ADVISOR
               http://www.cvg.cs.reading.ac.uk/~nts/ADVISOR/people_tracker.xsd".
Wrote test program xmlwrite.cc

(rb) Added new Calibration class to make access to full 3x4 projection matrix
and camera calibration data easier.  The calibration matrix is now read from a
separate file in NAG matrix format, defaulting to (video base name).calibration
similar to ....reference (via name_mangle, see imgsrc_utils.cc).

(rb) Added support for JPEG time stamp headers in JPEGSource.cc; this also
involved changes to frame referencing (changed name frame_number -> frame_id)
and new time storage (milliseconds since the Epoch  la POSIX.1 Annex B 2.2.2,
see time(2).

(pte) made {Image,Pipe}Source::get_current() use a recursive
get_source_frame_id() function to synchronise frame is with parents.  It means
we never have to call refresh() any more; get_current() recalc()s as necessary.
As a consequence, threw out many refresh()s from MotionDetector.cc.

MEDIUM TO MINOR CHANGES:

(pte) Re-structured MotionDetector: Only one constructor (changed calls to),
re-enabled background updating and introduced some more Globals parameters.

(pte) Made Image *get_current()s virtual to make strange problem with recursive
get_current() disappear.

Removed the -DMONOCHROME_8BIT define added in R0.2 and made the use of the
Grey8Image type for 2-colour images standard.  No more `BWImage's (see above).

`make depend' had a problem which meant we had to do a `make clean' every time
we changed a header file.  Fix to generic*.mk.

Renamed the PNM handling ImageSource from PgmSource to PnmSource (and the file
names, too).

Re-worked imgsrc_utils.cc and miscsrcs.h to enable use of skip= option.  Also
changed the SkipSource class because it assumed the first frame to have
frame_id == 0.

Changed ImageSource->get_{x,y}dim() methods and derived class SkipSource to
make sure we always have valid return values (no default to 0 in the virtual
default method any more).

Programs would not run on advisor1 after upgrading to libXt.so.6.0 and
libstdc++-libc6.2-2.  Fix to GlobalsManager.cc.

Changed `ImageSource's so get_current() would return valid images even in the
first frame.   Also, made some variables in ImageSource protected and changed
derived classes to have `private' access (not `public').

Removed imgsrc/SourceSplitter.cc and imgsrc/SourceSplitter.h because with the
re-worked `ImageSource's it should be possible to share an input between two or
more programs.

Removed time_skip from MotionDetector because it was not used.

Removed source/tracking/ExternalData.h and references to it as we don't support
use of car tracking data any more.

Changed some trackers not to do vidsrc->get_next() before starting (thereby
ignoring the first frame).  Now {Image,Pipe}Source allow you to call
get_current() right away.

Many more small changes, cosmetic and other...

--------------------------------------------------------------------------------

Revision 1.8 for Linux2: nts on Thu Aug  9 18:47:12 BST 2001

Changed the name of the class GlobalsManager to ConfigurationManager, and all
filenames and derived classes, as appropriate.  Variables will not be global
any more, and the class does handle configuration data (and the user interface
to configuration data).

Added icons for each program (defaults to default binary icon for now); added
utils/icons.h and some icons in the new utils/icons/ directory, some changes to
GlobalsManager/ConfigurationManager and all programs.  Set up in a way so it
can easily be changed when new icons are added.  Simply edit icons.h.

--------------------------------------------------------------------------------

Revision 1.9 for Linux2: nts on Wed Oct 17 15:28:21 BST 2001

Changed icon handling (utils/icons.h and ConfigurationManager class plus calls
to) to use colour icons, created some colour icons, changed default colours in
ConfigurationManager windows (Xt fallbacks).

progs/process_sequence.cc did not work with our new get_current() handling
(video input used to be a PipeSource not an ImageSource).  Fix.


Changed list(type)::duplicate() in utils/list.h to allocate memory and return a
pointer.  The method was not used but I would expect difficulties otherwise.

Re-enabled background_update_skip in MotionDetector (when using median
filtering).

Changed the default value of keep_edge_regions to true in the constructor of
RegionSet.  Sadly, this does not have any effect.  Edge regions are still
ignored.


NEW REGION TRACKER integrated into SimplePeopleTracker (because new tracking
shell is still not finished) which tracks `Region's from frame to frame.
Functionalities include region splitting and merging and are for CAR TRACKING
in the PETS2001 dataset 1, camera 1.  This is mainly for our article at
PETS2001 but I will move the region tracking algorithms into RegionTracker as
soon as the new tracking shell will be available.  For now and for ease of Code
merging most of the new Code is contained in files named
SimplePeopleTracker.cc_PETS2001 etc which were temporarily added to The Code.
If you would like to compile with the new functionalities, for now you would
have to rename the files.  Also look for "//PETS2001" comment(s).

Added new class MultiBackgroundSource (.cc and .h files in imgsrc/ directory)
which works as a wrapper to any background generating PipeSource and allows to
incorporate static objects (PETS2001: cars) into the background, thereby
enabling us to track people and other objects as they come close while not even
losing track of the static objects.

New file README with some notes for people at Thales trying to compile The
Code.

Added the option not to display any images.  To use, define NO_DISPLAY=1 in
generic.mk.  It -DNO_DISPLAY which in turn activates the features around The
Code.  simple_track (even with -DDEBUG and debug_level == 1) gives the exact
same results (text output, modulo pointer locations) which means it works :-)

Many more little changes and fixes around The Code.

Spell-checked this file with ispell.

--------------------------------------------------------------------------------

Revision 1.10 for Linux2: pte on Tue Sep 25 16:39:45 BST 2001
  under supervision of nts
  all merging by nts finished on Thu Oct 18 18:56:37 BST 2001
  checked in by nts on Fri Oct 19 10:01:51 BST 2001

  *** this revision is 2.0-alpha1 and cannot be considered stable ***

MAJOR MODIFICATIONS
Development of new Tracker Management Program to handle multiple trackers on
multiple cameras while incorporating time management to meet desired frame rates

New abstract class created (BaseTracker). All other trackers derived from
it. Added a Configuration Manager (configuration) allowing the reading and
storing of parameter files. Configuration parameters common to all trackers are
registered here. The registration is done in the constructor, all parameters
are stored locally

New abstract class created (ShapeTracker). Derived form BaseTracker. Simple
People Tracker and Ground People Tracker are derived from this. Configuration
parameters common to the shape trackers are registered here in the constructor
function and the variables are stored locally.

New Class Inputs created. Stores camera information that may be classified with
inputs. The class stores the filenames of sources and pointers to them. The
parameters are stored as private members of the class. Accessor and modifier
function created to facilitate access to the data externally. Configuration
parameters of the input flavour are registered in the constructor and are
stored locally in class members.

New Class Outputs created. This stores all camera information classified as
output such as display options (show_xxx_image). Accessors and modifiers
created to access information externally.

New Class Configuration created to store the unclassified parameters. The
parameter values are stored locally. The configuration variables are registered
in the constructor function. Accessors and modifiers created.

New Class Results created. The class contains pointers to tracking results
stores. (ProfileSet, SkeletonSet, HumanFeatureSet, RegionSet) The constructor
function creates new instances of the storage sets and sets the pointers in
their direction. The destructor function ensures that any allocated memory from
the global heap is deallocated.

New Class Tracking created. The class contains storage for the configuration
filenames for each tracker, a boolean value (use tracker or not), and a pointer
to the tracker for when it has been created. All information to be read into
the class is registered with the configuration manager and stored as members of
the class. The registration is done in the constructor function. The destructor
function ensures that if any space has been allocated for the storage that this
is freed.

New Camera Class created which stores a pointer to the classes just
described. The camera class also has a globals manager which is the same
globals manager to which the above classes registered their parameters. To
allow the configuration manager to directly access the private members of the
above classes, in order to store the values, the classes were made friends of
the configuration manager.

References to the previously global parameters were changed to reflect their
new locations. This involved passing extra parameters in some functions to get
the locally stored parameter to a separate class which required it.

Created constructor for the camera class. The constructor sets up the global
manager then creates the instances of the above described classes. This calls
the constructor functions for the classes registering the configuration
parameters. The camera setup parameter file is then read by the configuration
manager. This stores the parameter values in the desired places. The
constructor uses the values its read to open the correct sources and to set up
the desired trackers.

Simple People Tracker and Ground People Tracker modified to accommodate the
running of multiple trackers. A pointer to the associated camera is included in
the constructor. This means that the trackers can access the source and
reference images etc.. through the camera class instead of needing to make
multiple copies. The trackers were modified to allow them to share
resources. The motion detection was moved from the trackers to be carried out
in the main program. This avoids wasting resources in having multiple trackers
each performing the same motion detection. All source handling is taken away
from the trackers. This is now carried out in the main function also. The
OcclusionImage and WorldOcclusionHandler are taken from the trackers instead
these are shared per camera and accessed through the camera pointer. All
references to previously global information are changed to be access through
the camera pointer instead.

The motion detector constructor is changed to accept only a camera pointer
(gives access to all resources) and the filename for its configuration file.  A
Configuration Manager is included as a member to allow the handling of
configuration files. All references to resources are updated to go via the
camera pointer. The configuration parameters that are classified as motion
detector configuration variables are registered in the constructor for the
motion detector before the parameter file is read.


New main program (TrackerManagementProgram) created. The program uses the new
classes described above to allow the running of multiple trackers on the same
camera. The program also allows the running of multiple cameras.

To facilitate the increase in configuration parameters a new structure for the
parameters was created. The main program is passed the name of a system setup
parameter file which contains the names and associated parameter files for all
cameras to be included. The camera file contains the location of parameter
files for the motion detector, and any trackers to be used. The camera
parameter file also holds information on the sources and which trackers to use.

The new TrackerManagementProgram opens the system setup parameter file then
passes each camera_name and camera configuration file to the camera
constructor. The camera constructor sets up the cameras and trackers according
the configuration files. While there is still a valid camera source the program
goes through all cameras running the assigned trackers for each.

ConfigurationManager - modified to give errors if a configuration variable is
registered more than once (causes errors in reading reading parameter
files). Also modified to inform of any parameters given in a configuration file
which do not match with those registered. Other minor changes to ensure
robustness.

Region - removed is_ok() function from region. The function requires access to
configuration values which are no longer global. The functionality is
maintained through the function
MotionDetector::height_width_ratio_filter_regions(RegionSet* RES).

Profile - removed is_ok() function. The function required access to parameters
which are no longer global. the functionality of the function was replaced by
the function BaseTracker::height_width_ratio_filter_profiles().

MotionDetector - The motion detector in the past was called by the trackers
themselves but is now called once before all of the trackers. Modifications
were needed to give the same functionality with the different running order.
The masking of the profiles was removed from the MotionDetector. Current tracks
will now be found again as new regions, hopefully with the resulting profile
being recognised as a current track.

ImageSource - get_current(), made to be virtual, otherwise the program doesn't
function. 

A new instance of the "Results" class "previous_results" will hold the previous
results used initially by the region tracker only, but with an aim to utilise
the sets further. the function "void create_historical_data(Camera
*incam)". This function deletes the previous_results then copies the current
results over. Note! this causes the address of the sets to change, this must be
reflected with any local pointers being updated.

PipeSource - Modified, extra boolean variable "is_wrapper" added to accommodate
external_motion_sources. This ensures that they are handled like an ImageSource
with explicit calls to get_next(). The modifications are required by the
MotionDetector so foreground may always be a PipeSource.

Time management - added time management functionality to Tracker Management
Program. Inputs class has registered variables manage_time (switch time
management on/off), and desired_frame_rate. The time system used is
milliseconds since epoch time. The functions calculate_target_time(Camera*) and
current_time(Camera*) have been created to calculate the respective times. If
the system is running too far ahead of time, more than MIN_REST_TIME then it
sleeps until the next frame should be processed. When behind schedule more than
SLACK_TIME the program currently outputs a warning. This may be replaced with
procedures to reconfigure and speed up the offending camera.

XMLSource - added XMLSource per camera. This is created in the camera
constructor but is used in in the MotionDetector to extract region
information. A pointer to the XMLSource is stored in the
input->get_xml_regions_source.

XMLWriter - modified to work with image sequences without timestamp
encoding. The SequenceBuilder::add_frame() function was overloaded to also
accept the frame number, and a generated number in place of the timestamp,
whose value differs by (1000/desired_frame_rate) msec each frame. This allows
the functionality to be kept. Also the FRameBuilder::FrameBuilder constructor
was overloaded to pass on these values to where they were required.
 
Changed parameter name Configuration::quick_mode to quick_occlusion_reasoning

Changed parameter name Configuration::resample_shift to occlusion_resample_shift

MotionDetector: if statement added to avoid the appearance of dots representing
the unused profiles generated by the motion detector when the
SimplePeopleTracker is not active to remove them.


(nts) deleted PCA/MeanProfile.c because it was unused.

(nts) Forgot to include *_PETS2001 files in previous release.  Added.

(nts) Changed the name of the XML library from libXMLSource.a to libXML.a
because it now contains both XMLSource and XMLWriter classes (plus
DOMTreeErrorReporter).


--------------------------------------------------------------------------------


Revision 1.11 for Linux2: nts on Thu Nov 29 16:28:21 GMT 2001

  *** this revision is 1.99-beta1 and not a release ***

New tracking concept and major clean-up continued.

Some major ideas/changes for the new tracking concept:

 * Removed GroundPeopleTracker and WorldOcclusionHandler from compilation (plus
   all references to).  The new Calibration class is now used in
   SimplePeopleTracker (see below).

 * Created new classes TrackedObject and TrackedObjectSet, completely removing
   the old Code for the classes with these names.  A TrackedObject holds all
   the data for an object (person, group, car, other) including all profiles
   (person shapes/info), skeletons etc from all trackers.  Part of this new
   approach to store tracking data was the removal of the classes
   TrackedProfile and TrackedProfileSet, moving their functionality into
   Profile and ProfileSet, respectively.  There is a bool is_tracked in Profile
   which now holds the state of the Profile (replacing the hack with
   Profile::get_type() etc).  Replaced all references and instantiations of
   TrackedProfile/TrackedProfileSet with Profile/ProfileSet, thereby removing
   all sorts of type casting problems.
 
 * Created a new RegionTracker class.  This has nothing to do with the old
   RegionTrack class but was actually implemented from scratch using some Code
   from the PETS2001 modifications of SimplePeopleTracker.
   The new region tracker implements region splitting (a new, constructive
   approach, unlike the one used in PETS2001) and temporal background
   integration via the MultiBackgroundSource class.

 * Renamed basic tracking functions in BaseTracker and derived classes:
   predict_regions() and predict_profiles() now become predict_old_objects().
   This means that every tracker now does the same thing, using the same names:
   (1) predict_old_objects(), (2) track_old_objects(), (3) track_new_objects().
   They may chose to leave implementations empty, of course.

 * Enabled use of new Calibration class within the following trackers:

    - RegionTracker

    - HumanFeatureTracker

    - SimplePeopleTracker

   Calibration will be used if available, and its absence silently ignored.

 * RegionTracker and SimplePeopleTracker now exchange data via the common
   TrackedObjectSet *camera->results->get_tracked_objects().  After the other
   one has run, they will match non-matched predictions of their own to tracked
   objects of the other.  This increases robustness of tracks.

 

Removed lots of files: all of mpeg_lib-1.3.1/ and mpeg_play/, as well as the
unused utils/amb_vogl.h, imgsrc/RGB2GREYsrc.h, imgsrc/is.h,
imgsrc/FixHoleSource.h, imgsrc/imgfnct.cc, regions/ptest.cc and
regions/test/ptest.cc, utils/listtest.cc, matrix/testmatrix.cc and the archive
with old RCS data, old-RCS-data.tar.bz2.

Changed all `#include <ProfileSet.h>'s to `#include "ProfileSet.h"' etc (for
all our own header files) in all files to clearly distinguish our own include
files from system includes.  Our own includes are included using double quotes
"", system includes with angular brackets <>.  This is now consistent
throughout The Code.

Renamed class TrackedObjectList (plus files and references to) to
TrackedObjectSet to comply with general strategy (RegionSet, ProfileSet etc).

Changed file names regions/region.\({h,cc}\) to Region.\1 to reflect the name
of the defined class, Region (not region).  Similarly, changed
regions/profile.\({h,cc}\) to Profile.\1, matrix/point2.\({h,cc}\) to
Point2.\1 as well as files in imgsrc/: image.\({h,cc}\) to Image.\1 and
imgsrc\({h,cc}\) to ImageSource.\1.

Removed regions/RegionTrack.{h,cc}.  This was replace by a new RegionTracker
in the tracking/ directory (see above).

Created and added tracking/Inputs.cc and tracking/Outputs.cc by moving long
implementations out of the header files where methods are defined.

Changed name or directory regions/ to data/ because this is where data
structures are defined.  Moved the following files from tracking/ to data/
because they only define data types: HumanFeatureSet.cc, HumanFeatureSet.h,
HumanFeatures.cc, HumanFeatures.h, Skeleton.cc, Skeleton.h, /SkeletonSet.cc,
SkeletonSet.h.  Tricked CVS into thinking they had never been anywhere else.

Moved default_pca_model.h from tracking/ to PCA/ .

Window titles stopped to work a few revisions ago.  Fix.

Changed Profile class to remember track fitness in fitness variable, renamed
track error variable from frame_error to track_error.  Changed
SimplePeopleTracker accordingly.

Changed list(type)::duplicate() in utils/list.h to use add_a_copy() instead of
add() so it will not just create a list with pointers to the same items but
actually create a copy of the whole data pointed to.

Changed list(type)::destroy(item(type)* item) to have a slightly more logical
(and possibly more correct) functionality by re-arranging the `if's  and
putting some `else's.

Changed RGB32Image::copy() and Grey8Image::copy() to use the faster memcpy()
instead of a `for' loop to copy the image data.

Added Region::operator=, HumanFeatures::operator=, HeadInfoType::operator=,
Skeleton::operator=, TrackedObject::operator=, ColourBlob::operator=,
BoundaryPoints::operator= and made a small change to PointVector::operator= in
order to be able to TrackedObjectSet::duplicate().

Some memory allocation and deallocation debugging, especially for
Profile::~Profile and destructors of base classes.  Profile::~Profile used to
deallocate NagVector's memory (data) which causes trouble in the latter's
destruction.  Fix.  The only problem remaining seems to be that
Profile::~Profile cannot delete [] colour_info.  I will leave it commented out
for now.

Changed creation of historical data in TrackerManagementProgram.  Cleaner.

Modified list::add(...) and list::add_a_copy(...) to return pointers to the
newly allocated item (and not a number).

Added a method void Profile::update_size_variables() which sets the Observation
variables for size (bounding box and width/height).  This must be called after
each ActiveModel::track_profile() before accessing these variables (added in
SimplePeopleTracker).  This meant I could remove the methods
Profile::get_box(...), Profile::get_y_bounds(...) and Profile::get_size(), and
I did.  This should make things easier, a little faster (by "caching" the
values) and unify accesses to Observation classes.

Renames RegionSet::extract_regions(...) to extract_regions_and_subimages(...)
because it does.  Renamed RegionSet::extract_all_regions(...) to
extract_regions(...) to reflect that it does not extract the subimages.

HumanFeatureTracker::detect_heads(...) used to share v_hist data between all
heads of the same histogram which meant it was de-allocated more then once.
Fix.

Our implementation of List (old: list) classes used to be coded (by amb) using
preprocessor directives to avoid template problems of early template
implementations in C++ compilers.  That also meant editing of these files was
difficult and debugging within the implementation not possible.  I have
debugged part of the utils/list.h Code but there are more bugs.  So I re-wrote
the list (now List) class using `template's.  Meaning: data/List.h replaces
utils/list.h (and utils/lists.h was removed).  All calling code changed, too.
Also, added some assertions and `operator='s to List and all derived lists
classes.

Put some assertions around The Code to increase testing and maintainability of
The Code.  Uses the ISO C Standard (4.2 Diagnostics) assert (int expression)
function (#include <cassert>).

NB: `#define NDEBUG' for releases (when not defining DEBUG).

NB: New Code should make use of assertions to assure software quality.

Some Profile methods used to allocate a single ColourBlob for colour_info which
is actually an array.  Subsequent accesses caused problems much later.  Fix.

ProfileSet::filter_out_short(...) now allocates memory and returns a pointer to
avoid memory allocation problems.

Put some "const" qualifiers into NagMatrix and NagVector classes where they are
needed.  More might be necessary.

Allocated more memory in NagVector class to overcome allocation problems.  More
to do in NagVector and NagMatrix!

Removed some Leeds copyright notices (most of which outdated) from source
files.  Updated the global COPYRIGHT file explaining the situation.


--------------------------------------------------------------------------------


Revision 1.12 for Linux2: nts on Wed Feb 27 00:02:17 GMT 2002

  *** this revision is 1.99-pre1 and a pre-release for Thales for porting ***

Continued re-design for use of the people tracker within ADVISOR...

Designed and implemented new ImageSource class BufferedSlaveImageSource which
will be used with the new interface using the Thales Wrapper within ADVISOR
Testbed 2 and Demonstrator.

Introduced frame_time_in_ms variable into the Image class.  Moved frame_id
variable from ImageSource into Image.  Changed the Image class and all
ImageSource and PipeSource derived classes appropriately.  Now every Image has
a time (in milliseconds since the Epoch, as before) and a frame_id associated
with it which is and should always be always available.

Designed and implemented new class XMLRegionSource to read XML input (from
scratch), replacing the XMLSource class.  Now we use SAX (SAX2) because now in
Testbed 2 (and in the final ADVISOR system) we get chunks of XML data (per
frame) and not the whole file in one go (per video sequence) as in Testbed 1.
Added a class BufferedSlaveXMLRegionSource for ADVISOR system (Thales Wrapper)
which is basically a buffering version of XMLRegionSource which has the Thales
Wrapper interface (called indirectly, through our PeopleTracker class).

Working on porting The Code to Windows for Thales within ADVISOR...

Working with Thales to change our use of math libraries from NAG (mark 15) to
LAPACK/BLAS as an option.  Fixed NagMatrix.cc to assert() that math routines
are implemented.  This is so we can find difficulties which I believe still
exist.  Not finished yet.

Started removing references to cout and cerr since in the ADVISOR system we
will not be able to use them.  New `ostream's cinfo, cdebug and cerror are now
to be used.  These are declared in the new utils/text_output.h file.  They do
different things depending #ifdef THALES_WRAPPER.  In the future this
centralisation means we can write out debug info into a separate window and
similar nice things.  I have not finished replacing all cout, cerr and
printf/fprintf(stderr,...) yet since there are so many.


More maintenance and refactoring...

Complete re-structuring of the Tracking Code, continued.  There should even be
some documentation soon; I have started designing the Tracking class hierarchy
with Rational Rose and I have some nice diagrams now.

Renamed the SimplePeopleTracker to ActiveShapeTracker.  Our People Tracker now
contains more than one method to track people so the old name is not
appropriate any more.  In the old days, a SimplePeopleTracker would be a 2D
Active Shape Tracker without using camera calibration, and GroundPeopleTracker
would use (ground plane) camera calibration and 3D occlusion reasoning.  All
new trackers are given a pointer to a Calibration class or NULL and may chose
to use calibration as necessary, if it is available.  GroundPeopleTracker has
not been used any more for a while and is going to disappear soon.  I will have
to put in some more calibration (3D Kalman position filter and occlusion
handler) into the ActiveShapeTracker later.  Removed ShapeTracker class and
files and moved the things contained in there into ActiveShapeTracker.

Added frame_id_t, object_id_t and other types.  Put these plus many `#define's,
`typedef's and helpers (those are mostly inline functions like MAX(...)) into a
new file called utils/tracker_defines_typed_and_helpers.h .

Moved PnmStream::get_next() from file PnmSource.cc (who put it there in the
 first place?) to PnmStream.h.

Removed tracking/diffsrc.{cc,h} as it was not used (another class with similar
functionality exists elsewhere).  Removed imgsrc/RGBpixel.h (not used).

Renamed imgsrc/moviesrc.\({cc,h}\) to imgsrc/MovieSource.\1,
imgsrc/moviestore.\({cc,h}\) to imgsrc/MovieStore.\1, imgsrc/medsrc.\({cc,h}\)
to imgsrc/MedianFilterSource.\1 and the class defined therein from Medsrc to
MedianFilterSource and imgsrc/kernel.\({cc,h}\) to imgsrc/Kernel.\1 to reflect
the name of the classes defined in the files.

Replaced imgsrc/stack.{cc,h} (global stack, impossible to use) with new simple
Stack class defined in data/Stack.h --- only used in RegionSet class (which was
changed accordingly) to extract moving regions from a motion image.  FIXME: The
new implementation is safe but also slow to use as we allocate/deallocate
memory all the time.

Changed all files with a .hh extension to a .h extension instead.  This means
that the file names do not indicate whether the file is C or C++.  However,
Linux and many other good pieces of software also use .h always.  It makes
some things easier.

Changed many `int's to `unsigned int's where the signedness made no sense, to
avoid errors stemming from things like negative image dimensions.

Put some checking code (more assertions ...) around places to detect bugs.

Renamed Configuration class to CameraConfiguration to make clear it is only
used by the Camera class.

etc...


Removed some files in the version shipped to Thales, and replaced some files,
like tracking/SkeletonTracker.cc, with empty versions.


--------------------------------------------------------------------------------


Revision 1.13 for Linux2: nts on Thu Mar 21 17:17:15 GMT 2002

  *** this revision is 1.99-pre4 (pre2--pre3 not checked in) and a pre-release
      for Thales for porting *** 

Changed the endianness #define to say "LSB_FIRST" (it would be "MSB_FIRST" on
non-i386).

Many small changes in order to compile The Code on Thales' Windows machines.
(Still, they cannot do it.)

Added scripts/create-Thales-source script to create release for Thales from our
source directory.  

Added empty, non-function HumanFeatureTracker-empty.cc RegionTracker-empty.cc
and SkeletonTracker-empty.cc in tracking/ to replace the real versions for
Thales' copies of our source Code.

Continued work on tracking/PeopleTracker.{cc,h} for system integration.

Some small changes.

Moved old program executables (some not compilable any more and some outdated)
into progs/old-progs.tar.bz2.  Some of these might need to be revised at some
point, while all the tracking main() programs can go as they were replaced by
TrackerManagementProgram.cc (which is itself in the process of being replaced
by ReadingPeopleTracker.cc).

--------------------------------------------------------------------------------


Revision 1.14 for Linux2: nts on Mon Apr  1 18:47:07 BST 2002

  *** this revision is 1.99-pre5 and a pre-release for Thales for porting *** 

// This version also incorporates the new NagMatrix class for BLAS/LAPACK and a
// program progs/NagMatrix_test.cc with test cases for it, by Xin Wang `(xw)'

Made progs/convert_model work again (stopped after change with endianness
#define and some other recent re-structuring changes).

Changed generic.mk and some other `Makefile's for better readability and
cleaner structure (especially with XML and math libraries).

Removed the (little used) ErrorHandler class and all references to it.  If you
want to handle errors in future, throw() them.  I have started using try() and
catch() in some places already.


#ifdef _SVID_SOURCE around use of System V style 48-bit random number generator
functions was not complete.  Fix.

Thales Porting / System Integration:

Removed all references to cout and cerr, as well as all printf and
fprintf(stderr, ...).  Now only cinfo, cdebug and cerror are used.  These are
declared in the utils/text_output.h file introduced in revision 1.12.

The Code compiles with __STRICT_ANSI__ option set.


More Clean-Up and Maintainability work:

Finally removed all MPEG reading ability from The Code.  Reasons:

  a) This further reduction in Code size and complexity helps maintainability.
  b) The MPEG reading is not needed for ADVISOR and has not been used in
     almost 2 years.  We use individual JPEG images only.
  c) The MPEG library included in our source Code (mpeg_lib/ directory) is from
     Berkeley, modified by AMB in 1995 to allow random access to frames
     (seeking).  This added feature is not useful for our application, realtime
     people tracking.
  d) The Berkeley MPEG library is available, pre-compiled, as a system library
     under Linux and other systems.  If in future we need MPEG support it can
     be revived without any significant effort using the system library only.

Removed SGI specific MOVI file input implementation (mostly imgsrc/Movie.h and
imgsrc/MovieSource.cc).  It has not been used in more than 2 years, it is a
non-standard video format and the source files clutter up our Code.

Renamed utils/profiling.{cc,h} to Profiling and moved the contents in a newly
created purely static class called Profiling.  This removes some more global
variables and functions.  The class is not used now, however, it might be
useful in the future.

Similarly, moved contents of H_metric.{cc,h} (in PCA/) as static variables and
methods into newly created HMetric class with the corrected filename
HMetric.{cc,h}.

Removed the remains of the old GroundPeopleTracker class, along with
GroundPlaneToImagePlane.{cc,h}, WorldOcclusionHandler.{cc,h} (useful but unused
and outdated) and GPfilter.{cc,h} (replaced by Calibration class).

Removed the unused ProActiveModel class.

Removed the unfinished tries to make our NagMatrix and NagVector classes more
safe and bug-less, namely files new-NagMatrix.{cc,h} and new-NagVector.{cc,h}
in matrix/.

Removed vogl.tar.bz2 and the (already empty) vogl/ directories.  vogl is not
used now and it was no written by us.  Hence it does not belong into our source
code.  Some vogl references remain in The Code (with #ifdef USE_VOGL and/or
#ifndef USE_GL / #ifdef USE_GL #else) for now and might be removed later.

Removed unused matrix/MathRoutines.h

Removed PCA/Tracker.{cc,h}.   Used in PCA/ProfileSequence.cc but the
functionality should be taken from RegionTracker if necessary.

Changed Profile.cc and SplineWeights class, making some global variables and
functions static members of the class (most prominently,
Profile::NO_CONTROL_POINTS).

Removed unused data/shape_constants.{h,cc}

Clean-up of file data/bspline.cc: it contained BoundaryPoints method
definitions, a SplineMatrix class declaration and definition, as well as global
functions.  Moved class {declaration,definition} to SplineMatrix.{h,cc},
BoundaryPoints methods into BoundaryPoints.cc, global functions to static
member functions of one of the classes, as appropriate.

Some more int to unsigned int where a signed int could cause trouble (array
index etc).

Moved global functions and variables (locally used,  la amb) from Image.cc
into Image class.

Moved the 2 global read_pnm functions into PnmSource class (as static member
functions).

Removed unused and superfluous imgsrc/egetopt.cc.

Moved global realno normal_random() function into NagVector class for now.

Removed unused PolyFilter class (was in matrix/PolyFilter.{cc,h}).

Moved contents of tracking/colour_edge_detection.{cc,h} into
imgsrc/RGB32Image.h and imgsrc/HSV32Image.h (global functions into static
member functions).

Removed global create_new_id() function.  Use new static create_new_id() method
in PeopleTracker class instead!

Moved many other global functions into classes, mainly in classes ActiveModel,
Image, Grey8Image, RGB32Image, HSV32Image, ProfileSequence, Skeleton,
RegionTracker and SkeletonTracker and from the file MedianFilterSource.cc.
This task is now completed with the exception of only about 3 classes/files.
Among these are utils/tracker_defines_typed_and_helpers.h with our global
helpers like MIN(...) and MAX(...), also global `operator's (should be OK) and 


Moved contents of imgsrc/Grey8diff.cc into Grey8Image class.

Removed unused utils/split_num_filename.{cc,h}.

Merged in Xin Wang (xw)'s new BLAS/LAPACK implementation of 3 NagMatrix
methods, completing the task started by Dani Ponsa in summer 2000 to switch
from NAG.  Now it should be possible to use BLAS/LAPACK (3.0) instead of NAG
(mark 15) math libraries.  This was necessary for Thales' porting to Windows
as they did not want to pay the NAG licence.

(xw) Added progs/NagMatrix_test.cc with a program with simple test cases for
     the NagMatrix class.  This is to test whether the new BLAS/LAPACK
     implementations do the expected thing.  Results: The program compiles and
     we can successfully call the routines.  The output differs between NAG and
     BLAS/LAPACK.  However, some results are not unique.  Hence, more testing
     is necessary.


--------------------------------------------------------------------------------


Revision 1.15 for Linux2: nts on Mon Apr 22 18:41:29 BST 2002

  *** this revision is 1.99-pre8 and a pre-release for Thales for porting *** 

// This version also incorporates the new NagMatrix_test.cc by Xin Wang `(xw)'

// This Code compiles and can be linked under Windows, with our own main() program.

More changes to The Code for Thales' porting of it to Windows (WIN32 target).
Since they have not done, it, I have compiled The Code, with Microsoft Visual
C++ 6.0.  There were some changes necessary, mostly since the Microsoft C++
compiler is not ISO C.  Now it compiles.  The defines necessary in Visual C++
are WIN32, NO_DISPLAY, USE_GL, USE_LAPACK, DISPLAY_POLY, THALES_WRAPPER,
LSB_FIRST, HAVE_BOOL, __STRICT_ANSI__, __STDC__ and  cerror=cerr.
__STDC__ is for Windows system include files, cerror will be defined by Thales
in their system.  I have changed some of the Linux system header files I used
to compile, so that they would not span across too many files.  This is to
minimise the number of non-Microsoft system include files used.  Only a few
types are needed from there, anyway.

Created new base class NumberedFiles which contains methods to handle numbered
input or output files.  Give first numbered file, eg
"/advisor/video/STIB/YZER/2.1.05/C05/007000.jpg", as parameter to constructor
to use.  This class is now a base class for JPEGSource and PnmSource which used
to do the same thing for numbered files (split string into 3 parts, create
filenames for each file number etc).

Totally re-worked NagVector and NagMatrix classes to remove problems with
memory allocation, problems with constness and signed int madness.

Created new main() program (basically, from scratch, removing almost everything
in the existing file) progs/ReadingPeopleTracker.cc .  The program is small, it
has a few configuration options and uses these to simply start a PeopleTracker
class which does the whole job.

Removed some unused main programs.

Created new file utils/os_specific_things.h which contains those OS specific
`define's etc which are particularly fragile during porting.  The file contains
type definitions like u_int32_t and u_int64_t, sleep() and usleep() functions,
a new ostream &operator<< (const u_int64_t &number) because Microsoft C++ does
not have one etc.  This file is COMPLETE in that it provides everything needed
to compile The Code under Windows (complete with linking and main() program
with some help by Tugdual LeBouffant (tl) on Mon Apr 22).  There is no more
need for Linux (ISO C) system include files like in the previous pre-release.
This also meant that we cannot use <unistd.h> any more unless we are under
non-Windows which is fine.

Added utils/strcasecmp.h and utils/strncasecmp.h which implement the BSD 4.3
functions with the same name.  The code is from the University of California at
Berkeley (UCB) and was downloaded from the
http://web.mit.edu/afs/athena/astaff/project/gccdev/egcs/libiberty/ directory.
Adjusted the functions slightly for use with C++ in our system.  They will be
included --- iff needed --- by utils/os_specific_things.h.

Changed some small things all over the place (like removing unused variables)
after switching many warning options on with our compiler.   Now The Code
compiles with many warnings enabled, with no compiler warning.

Added optional "master" NumberedFiles and ImageSource parameters to
BufferedSlaveXMLRegionSource and BufferedSlaveImageSource constructors.  If
given, a) the slave sources will automatically try to get data from the master
if their buffers run dry on a get_next() call, and b) allow to fill up the
buffer through a fill_buffer() method.  This way, these sources can be used as
a buffered "normal" file input.  The syntax is to use
"VIDEO_IMAGE_SOURCE_FILENAME slave,/advisor/video/LUL/c38/01/0001.jpg" etc in
the respective config file for the input for a given camera.  In this example,
a JPEGSource would be instantiated for the master, and
inputs->video_image_source would be an associated BufferedSlaveImageSource.
You can do inputs->video_image_source->get_next() as before.

The setup of inputs and the handling of new input (get_next(), frame id
wraparound handling etc) is now completely done in the Input class where this
intelligence belongs.

More work on PeopleTracker and Camera to handle input and start tracking.  This
is part of the continued work for us to use the new interface to our tracker
that was necessary through Thales' design of an interface to our tracker.

Changed some more integer types to unsigned, and also tried to change all frame
id types to frame_id_t.

New utils/NumberedFileSource.{cc,h} with a class NumberedFileSource (uses base
class NumberedFiles) for classes which read numbered input files.  Simply pass
the first filename as an argument to the constructor and it will provide you
with contents of files in memory via get_next() method  la ImageSource.  This
class is now used to read single, numbered XML files into memory to pass them
using NumberedFileSource as a master (input) class to a
BufferedSlaveXMLRegionSource class.

Renamed Outputs class to ScreenOutput because that is what it is there for.

Updated ScreenOutput::update_displays and created a new
ScreenOutput::draw_results(Inputs *inputs, Results *results) who do the
expected things.

Removed tracking/CameraConfiguration.h and put things into Camera class.  Added
a register_configuration_parameters() there, like many other classes do it.

Removed unused matrix/ListMatrix.{cc,h} which defined sets of NagMatrix and
NagVector classes.

Moved global EnvIntParameter image_class_zoom to static EnvIntParameter
*Image::display_zoom .

Added a few forgotten #ifdef HSV32 around usages of these functions.

For WIN32, using the Intel MKL BLAS/LAPACK implementation, changed NagMatrix.cc
to use all-uppercase names without underscore for the functions.  Also,
included <mkl.h> and added some new `#define's for USE_FLOAT.  USE_FLOAT now
works when using BLAS/LAPACK libraries.

Moved some implementations from Results.h to Results.cc, specifically a newly
created ostream &Results::operator<< which writes out tracking results in XML
format, and a Results &Results::operator= (Results &original) which does the
expected things.

More small fixes and beautifications all over the place.

Our main tasks for System Integration (New Functionality and Porting to
 Windows) are hereby complete, although some modules are untested.

(xw) updated the program with test cases for the NagMatrix class,
     progs/NagMatrix_test.cc.


--------------------------------------------------------------------------------

Revision 1.16 for Linux2: nts on Fri Jun 14 18:06:13 BST 2002

 
Temporary fix in JPEGSource to avoid strange problems with libjpeg, see
imgsrc/JPEGSource.{cc,h}-jpegproblems.

Removed Profile::grab_data method.  Use the operator= instead, it works fine
now.

Removed Profile::output_to_stream(ostream &out_strm) and moved the
implementation to the operator<<.

Moved the &Results::operator<< outside of the class (should it have worked?).

Moved all global (that is, PeopleTracker) configuration parameters like camera
names etc from the main program to the PeopleTracker class.  That way main()
and PeopleTracker do not share a ConfigurationManager class any more.

Changed TrackedObjectSet::add_observations? interface so it does not need the a
Camera pointer any more (bad design).

Made the virtual ImageSource::get_{x,y}dim() const so that overloaded const
methods are not silently ignored.

MotionDetector had a small memory leak (a List container was not deleted).  Fix.

ForegroundEdgeDetector used refimg to query image dimensions even when it was
NULL.  Fix.

BufferedSlaveImageSource did not set xml_data_size_in_buffer in get_next().
Fix.

XMLRegionHandler and XMLRegionSource did not write out error messages
correctly.  Fix.

Changed the virtual Image::ImageType imgtype() (now get_image_type() const)
method because we had problems (base class method was called instead of
re-defined method in derived class).

Made Image::~Image() non-virtual so that image data will always be de-allocated
(eg, there is Grey8Image::~Grey8Image() which does not de-allocate image data).

BufferedSlaveImageSource used to de-allocate the image memory before calling
master_image_source->get_next() which caused a NULL current to be checked for
its frame number.  Fix.

Removed unused classes BasePixel, GreyPixel and ImagePyramid; the latter,
depending on the others, being a class to store images in multiple resolutions,
for fast template matching.  We do not do template matching.

Call setup_cameras() after configuration->create_interface(0, NULL) in
PeopleTracker::PeopleTracker so that the tracking only starts after the user
clicks "OK" in the interface.  This is not perfect; some of the things from
setup_cameras(), namely configuring cameras, but not starting threads, might
need to be done before configuration->create_interface(0, NULL).


--------------------------------------------------------------------------------


Revision 1.17 for Linux2: Sarah Laval (sl) on Thu Aug  1 14:21:46 BST 2002
  under supervision of nts
  checked in by nts on Thu Aug 15 13:38:05 BST 2002

Created two new classes IEEE1394Adaptor and IEEE1394Source to read frames from
a digital video (DV) source, a DV camera or camcorder connected via IEEE1394
(aka FireWire aka i.Link).  IEEE1394Adaptor handles the hardware (using
libraw1394, librom1394 and libavc1394 libraries).  It maintains a connection to
the DV camcorder and retrieves individual DV-encoded frames from the camera.
IEEE1394Source is a new ImageSource class which holds the DV encoded data from
the DV Camcorder and decodes it using the libdv library.  It creates a new
RGB32Image, where the current decoded frame is stored.



--------------------------------------------------------------------------------

 
Revision 1.18 for Linux2: nts on Thu Aug 15 14:28:13 BST 2002

-- maintenance release; not running error-free yet

Removed draw methods from TrackedObjectSet class because they are now in
ScreenOutput.  draw_*_in_image are still there.

Introduced the new variable ImageSource::frame_count.  It should simply count
the number of calls to get_next() and can be queried by get_frame_count().
NB Please implement ``frame_count++'' in get_next() of all new ImageSource
classes.  // FIXME: necessary for any PipeSource::get_next() as well?

BufferedSlaveImageSource used to create a problem for its master_image_source
because that assumed that the previous current has not changed when get_next()
is called.  In fact, we deleted that current Image in BufferedSlaveImageSource.
Now this has changed; we manage the Image memory to minimise allocations and
de-allocations by keeping the Image memory for later.  Then before each call to
master_image_source->get_next() we get new Image memory for our master's new
current Image and set the frame_id etc from the previous current frame.  It's
simpler than it sounds.  This fixes a nasty BufferedSlaveImageSource bug.

Made some methods in Image class purely virtual (= 0).  Also, changed the
``return NULL'' to ``abort()'' in methods that have to be redefined before
used.  More such work is necessary to clean up this class.

Set own_data to true in Image::set_data(unsigned char *new_data), assuming that
the new image memory has been allocated for us and hence needs to be
de-allocated by us.

Camera.cc had a ``#ifdef DISPLAY'' instead of ``#ifndef NO_DISPLAY''.  Fix.

Camera::do_processing forgot to do ``*previous_results = *results'' which was
expected (and even documented) in PeopleTracker::do_processing.  Fix.

Camera::Camera needed to set ``previous_results->status = RESULTS_PROCESSED''.
As it did not, Camera::do_processing was waiting forever in the first frame.
Fix.

PeopleTracker used to omit some characters when writing out XML data (typos).
Fix.

Option to write out the XML tracking results into a file (in PeopleTracker).
Use the new XML_TRACKING_RESULTS_FILENAME config option.

Preserve window handle (with GL, glwin variable) when changing over `current'
Image to the next in BufferedSlaveImageSource.  Implemented Image::[sg]et_glwin
methods to aid in this.

XMLRegionHandler::handle_blob used to create a new Region (new_region) but is
was never added to the current_region_set.  Hence no output.  Fix.

XMLRegionHandler filled new_region->blob_data but the data was not copied over
to Observation variables afterwards.  Now we are doing that in
Inputs::get_external_xml_regions().  Also there: flipping of INRIA XML data
which is upside down (namely, top to bottom).

MotionDetector had some bugs after the fixes for Thales/ADVISOR system.  Fixed
some of them (possibly not all).

Added some assertions and other beautifications all over the place.

New configuration option USE_MULTI_BACKGROUND_SOURCE in MotionDetector to use
the new (well, end-2001) MultiBackgroundSource class which allows to
incorporate static objects temporarily into the background.  This is done by
the RegionTracker which can now handle both cases correctly.

Changed class names ColouredForegroundEdgeDetector to
ColourForegroundEdgeDetector, ColouredEdgeDetector to ColourEdgeDetector,
NormForeColourDetect to NormalisedColourForegroundEdgeDetector, SobelDetector
to SobelEdgeDetector.  The new names are longer but more logical and easier to
remember or guess.

Changed ActiveShapeTracker so it does not have a pointer to Tracking any more,
but still a pointer (during construction only) to the MotionDetector.  Changed
edge detectors accordingly to which the pointer was given.

Changed the new Input methods to handle the case that external inputs are not
available (I had forgotten it before).  They now just return NULL for external
data sets if nothing is available.

Some clean-up in PipeSource and derived classes (file PipeSourceFilters.h).
Removed the refresh() from all constructors of PipeSource derived classes.  The
rationale behind this is that upon construction of these classes, no current
image might be available from the source class and it would be wrong to call
get_current().  Fixed RepeatSource, SkipSource.

Made some methods purely virtual in ImageSource.  I had tried this before but
only completed it this time (it required some changes of derived classes).

Removed unused methods in ImageSource class: get_current_filename(), restart(),
goto_frame(frame_id_t new_frame_id), get_number_of_available_images().  Some
related clean-up in derived classes, like JPEGSource.

Moved OcclusionImage from Tracking into Results because that's where it
belongs.

Removed pointer to ActiveShapeTracker in Profile.  It was only there to write
data to screen and that operator<< should use other world position variables
(which might have to be re-implemented...).

Changed #ifdef HAVE_BSPLINES to #ifndef DISPLAY_POLY in Profile and
BoundaryPoints.

A use_precalculated_difference configuration variable
(PRECALCULATE_DIFFERENCE_IMAGE) used to be defined both in ActiveShapeTracker
and MotionDetector.  Removed it from the first.

Strange problem in inline realno Point2::length() { return sqrt(x*x + y*y); }.
It returned NAN for small vectors and hence caused trouble in ActiveModel.
Also, linking errors while trying to solve the problem by removing the
"inline".  Moved implementations from Point2.h to Point2.cc to fix.

OcclusionImage was not used because it was broken.  Fixed it by giving
object_id parameter to setup_occlusion_map (required changes to ActiveModel and
OcclusionHandler).  Also, made some methods purely virtual in OcclusionHandler
and fixed an error in MotionDetector: it had copied the additional occlusion
mask into the tracked_mask (used as the occlusion image).  In fact, it needs to
be negated.  Added a variable for the inverted copy of the additional occlusion
mask to save CPU time.

Added Grey8Image::invert() (simple, fast binary negation).

Added ImageType ImageSource::get_image_type() const in the style of get_xdim().
It has to return sensible values after instantiation without allocating current.

Big changes/refactoring in EdgeDetector, ActiveModel (changes in
ActiveShapeTracker were necessary as a result):

   * EdgeDetector constructors do not get pointers to images.  They may not
     assume that image locations (eg, current video image) remain constant over
     time so they will not hold pointers to them.

   * ActiveModel holds current video, background and difference images and
     previous video image (if available) for use by its EdgeDetectors.

   * static EdgeDetector methods do not make any mess any more with wild void
     *userdata casts.  Instead, they get a pointer to the active_model.  They
     query the current images from the ActiveModel when they need it.

   * ActiveModel the video image source's ImageType upon instantiation.  This
     can be queried by EdgeDetector constructors and methods who do different
     things for RGB32 and GREY8.  EdgeDetector classes can now query

   * made EdgeDetector::find_edge purely virtual.

   * added some assertions and checks.


Typo in ostream &operator<< (ostream &out, const Results &results) (one to many
`;') gave strange error.  Found it through an assertion, fixed it.

Tried to track down problems in Calibration and (possibly) NagMatrix.  These
have influences in ActiveModel and any tracker using Calibration.  Checked and
fixed test case progs/Calibration_test.cc to make better testing possible.
Fixed some things in Point2, NagVector and NagMatrix.  However, problems still
exist.


--------------------------------------------------------------------------------


Revision 1.19 for Linux2: nts on Thu Aug 15 15:13:51 BST 2002

Only change: Removed support for use in Thales wrapper (#ifdef THALES_WRAPPER
bits) as it is not required any more.  This included the removal of some files
not maintained by us: interface/ptinterface.cc, interface/ptinterface.h,
interface/ptwrapper.h, interface/wrapperstream.cpp, interface/wrapperstream.h.

I will leave interface/timestamp_c.h in the code because we use JPEG images
with the timestamp in them.


--------------------------------------------------------------------------------

Revision 1.20 for Linux2: nts on Mon Nov 25 15:50:41 GMT 2002

--Maintenance release: Mostly bug fixes.
--Changes marked `(xw)' are fixes for bugs detected by Xin Wang

Removed some commented our debugging code in HumanFeatureTracker, added an
assertion because we assume that the image addressing mode is BOTTOM_TO_TOP.

Changed optimisation options in generic.mk to Pentium Pro (and newer CPUs).

In NagMatrix: set `own_data' to false whenever we assign `data = NULL'.

(xw) In NagMatrix: replaced wrong `data' assignments (copying first element
only) with memcpy of the whole source `data'.

Changed NagMatrix::NagMatrix(unsigned int n, unsigned int m, const NagVector
&v): force v to have valid size (assertion plus `else' clause),

In NagMatrix: removed `#ifdef MATRIX_DEBUG' from some checking code.

NagVector::NagVector did not honour the_alloc_size parameter when allocating
data.  Fix.

Changed NagVector::reset() so that it would set size, alloc_size and data.

In Calibration: changed return and parameter types of methods:
  1 - `const realno &' parameters changed to `const realno'
  2 - `NagVector &' and `NagMatrix &' return values changed to `NagVector' and
      `NagMatrix', respectively, because the objects were allocated on the heap.
  3 - no more `new NagVector' or `new NagMatrix' allocation and then returning
      a pointer (there was no-one to de-allocate the memory)

Check for stack underflow in Stack:pop method: added an assertion and an `if'.

Added debug message in ActiveShapeTracker::detect_new_objects() if no more
objects are detectable because we already have max_objects objects.

After drawing the head the colour was not reset according to the object id in
the ScreenOutput::draw_results method.  Fix.

(xw) Changed DEFAULT_STACKSIZE from 8192 to 32768 in
utils/tracker_defines_types_and_helpers.h

Corrected normalisation factor in RegionTracker::region_difference from
2.80277563773199 to 3.216989200105089695361299.  As a result, the calculated
region difference is now scaled; configuration files might need to be updated.

Removed some debug output from Calibration::get_world_from_ip(...) and from the
classes ActiveModel, PeopleTracker, IEEE1394Adaptor, IEEE1394Source and
ScreenOutput.

Added length check for calibration filename in Calibration constructor.

Changed main interface name from main to ReadingPeopleTracker in
ConfigurationManager::create_interface().

Camera::do_processing forgot to call
results->get_tracked_objects()->remove_old_tracks(...) so that old objects were
kept forever.  Fix.

Added is_dataflow = false in IEEE1394Adaptor::stop_dataflow and a query of
the variable in IEEE1394Adaptor::capture_frame.

After speaking to Anthony Worrall, added comments to MedianFilterSource about
its origin.  Also, changed some whitespace and comments.

Added virtual ImageType IEEE1394Source::get_image_type() because it was missing.

Changed PNM file handling for image writing in RGB32Image::save_pnm method.

Added a new IEEE1394_Capture program for capturing images of students at the
course registration.  It also doubles as a test case for the IEEE1394Adaptor
and IEEE1394Source classes.

Added setlinestyle(0) in ActiveModel::quick_observe_point method (for drawing
debug output).

Cleaned away commented out code from HumanFeatureTracker, also improved some
comments.  

Added code in RegionTracker::post_process_frame method to clean away old
unmatched objects.  Their maximum age is determined by the new MAX_KEEP_ALIVE
configuration variable for the RegionTracker.  It determines for how many
frames an unseen object should be predicted and kept before marking it for
deletion from the tracked objects.

In ScreenOutput::update_displays method, reset drawing colour after drawing the
HumanFeatures because it was set to red or pink.

In TrackedObjectSet::remove_old_tracks method, replaced the "large" frame id
10000 by FRAME_ID_T_MAX.


--------------------------------------------------------------------------------

Revision 1.21 for Linux2: nts on Mon Dec  2 13:56:42 GMT 2002
--Maintenance release: Mostly bug fixes.

Added a missing reference to Xin Wang and some small bits of additional
information in the previous change log.

In RegionTracker::post_process_frame method: Changed ">" to ">=" in comparison
with max_keep_alive.

In IEEE1394Adaptor::find_camera method: completed change of variable names
started in the previous version.

Improved error messages for invalid dimensions/type in PnmSource::read_pnm.

Removed display() (was there for debugging) in JPEGSource::get_next when image
dimensions/type is wrong.

Changed name of variable in NagMatrix::solve_equations: `x' instead of `res'
because we solve Ax = B.

In Calibration class: Added assertions to check for valid (homogeneous) vector
format in arguments for all methods expecting a NagVector as an argument.

In Calibration class: The methods get_world_from_ip,
get_image_distance_from_width_in_cm, get_image_distance_from_height_in_cm,
get_world_distance_from_height_in_pixels and
get_world_distance_from_width_in_pixels failed to create valid homogeneous
coordinates before calling other methods.  Fix.

In test case Calibration_test: pressing space should get you to the next
image.  This feature was broken.  Fix.

Rewrote Calibration::get_world_from_ip method from scratch.  Added correction
term for image addressing mode.

Added image height parameter to Calibration::set_image_addressing_mode because
otherwise we cannot correct coordinates.

Renamed Image::set_color to Image::set_colour.

Removed declaration of the ::set_color(unsigned int col) function from Image.h 

Removed setting colour in Region::draw_box()

Removed unused Image::get_value method.

Removed some commented out code from a number of files.

Cleared up image addressing mess.  Introduced new public static const variable
Image::image_storage_mode which determines how an image is stored in memory
(IA_TOP_TO_BOTTOM or IA_BOTTOM_TO_TOP).  The existing variable
Image::image_addressing_mode is now also public, static and const, and solely
states how we are calling the line numbers.  (This should always be
IA_BOTTOM_TO_TOP.)  This means that all images are now treated equally, but
this constraint is not constraining, rather avoiding chaos.  The change has
necessitated changes in a number of other modules.  All references to image
addressing (often really referring to the storage) have been checked and
corrected.  Removed Image::reset_image_addressing method.

Corrected wrong `if' and `for' statements in modules JPEGSource, MovieStore,
Grey8Image, RGB32Image and NumberedFiles where unsigned int variables were
compared `>= 0'.

Added some assertions in the Image class.

Removed value IA_UNDEFINED from ImageAddressing enum type because we always
need to know the image addressing mode.

Removed CHECKED_MARK constant because it was only used for debugging in the
past.

Check for file reading error in PnmSource::read_pnm.

In both RegionSet::grab_regions, corrected tnx and tny variables.  They were
assigned coordinates just outside the image (e.g. width not width-1)

Removed unsigned char *Image::check_pixel because the same functionality is
given by bool Image::check_coords and unsigned char *Image::get_pixel.  Hence,
changed RGB32Image::difference and a number of other methods in the RGB32Image
and Grey8Image classes accordingly.

Added assertions in Grey8Image::extract_subimage, removed redundant code.

Changed some `NagVector's to be homogeneous vectors (this was expected in
Calibration) in classes HumanFeatureTracker and ActiveShapeTracker.

int NagMatrix::IFAIL used to be static which can create difficulties in our
multi-threaded system.  Removed it and replaced it by local variables in those
methods that use it.

In NagMatrix::solve_equations, replaced call to NAG routine f04aef by f04jgf.
The replacement also solves overdetermined systems of AX = B, giving the least
squares solution for X.

Fixed the copy constructor NagMatrix(const NagMatrix &m) (initialising
variables correctly).

Unified type of parameters in virtual methods Image::plot_pixel,
Grey8Image::plot_pixel and RGB32Image::plot_pixel to unsigned int.

Added draw_vertical method in Image, Grey8Image and RGB32Image classes.

Added optional `dotted' parameter (default: false) to draw_horizontal and
draw_vertical methods in Image, Grey8Image and RGB32Image classes.  When true,
draw dotted lines (using a very simple algorithm).

Added Region::draw_box_in_image(Image *canvas) method to draw the bounding box
into an Image (not to screen).

Added RegionSet::draw_boxes_in_image(Image *canvas, frame_id_t min_age = 0)
method to call drawing functions of all `Region's that have been seen for at
least the previous min_age frames.

Added drawing regions in TrackedObjectSet::draw_all_in_image method.

Changed type of some parameters that count frames, to frame_id_t.

RegionTracker::match_regions_in_objects did not set the time_first_detected and
frame_first_detected correctly.  Fix.

In ActiveShapeTracker::compare_two_and_disable_bad_profile, consider age for
similarly good fitting profiles, keep the one which is significantly older.

The PeopleTracker class did not honour the -q command line parameter
(quiet_mode).  Fix.  Now the Camera class also handles quiet_mode itself and
never calls ScreenOutput routines.

In Image::draw_filled_polygon, qsort used to loop infinitely if the number of
elements, nact, is 0.  I have put a new if.

Fixed test case progs/Calibration_test.cc which wrongly assumed that GL
addresses images TOP_TO_BOTTOM.


--------------------------------------------------------------------------------

Revision 1.22 for Linux2: nts on Wed Dec  4 14:53:41 GMT 2002

RegionTracker::split_and_merge_regions did not honour the max_merge_difference
configuration variable, using the value 30 instead.  Fix.

More debugging in Calibration class because it still gives very strange
results.  Re-implemented Calibration::get_world_from_ip and
Calibration::get_world_distance_from_height_in_pixels methods from scratch,
again, this time avoiding homogeneous coordinates.

Removed declaration of unused variable desired_framerate in JPEGSource and
its commented out definition in PeopleTracker.

Limit the number of error messages for invalid time stamp headers to 3 in
JPEGSource::get_next method because frames are likely to have the same error.

Calibration::get_world_distance_from_height_in_pixels did not determine the
v coordinate of the lower image point correctly.  Fix.

Removed the default value for parameters to Calibration methods.  Changed the
calling functions.

The Point2 version of Calibration::get_world_from_ip did not honour the height
parameter.  Fix.

New configuration variable NEW_HYPOTHESIS_REPLACES_MEASUREMENT for the
ActiveShapeTracker which determines whether to remove the original measurement
when creating new hypotheses using calibration.

ActiveShapeTracker::track_old_objects used to destroy a bad profile, then
access it for debug output.  Although no specific problem was detected, this
was changed.

Changed memory allocation and handling in ProfileSet::gauss_smooth method.

Removed unused and undocumented boolean parameter `flag' from Profile::draw and
ProfileSet::draw methods.

Do not draw invisible profiles (lost tracks, predictions) in Profile::draw.

In List class, set current to NULL whenever we set both first and last to NULL.

Removed unused ProfileSet::filter_out_short method.

Destroy old data in list l in template <class type> istream &operator>>(istream
&in_strm, List<type> &l) before reading new data, in List.cc.

Changed some methods in the List class such that they do not modify, or shadow
the `current' variable.

Removed some member variable initialisations from constructors of classes
derived from the List class which were also found in List::List.

In Image::draw_filled_polygon method, made the y variable signed.  Otherwise
drawing in the image (not to screen) loops forever.

The Calibration class was again re-written.  Since there were still problems,
the algorithms from end July 2001 were used as a starting point.  Then all
additional (new) corrections and tests, as well as many assertions were
inserted.  The test cases now suggest that the old, mostly working
functionality has been restored while adding more tests and robustness.

The calibration matrix's image addressing mode is now determined with a simple
test in Calibration::Calibration and Calibration methods use this information,

Removed unused and commented out code from Profile class.

Removed some comments about who did what in The Code, and when.  Those comments
are not necessary now (this file has the information, if someone cares), and
they distract from the actual code and useful comments.

In NagMatrix::solve_equations method, increased tolerance variable TOL to
0.000005 (about 6 significant digits).

Fixed some bugs in the test case Calibration_test, most noticeably the checking
of u coordinates to see which point is higher up

Cleaned up the code in ActiveShapeTracker::create_hypotheses_using_calibration
which calls Calibration methods.  Made it more readable.

In the TrackedObjectSet::draw_all_in_image method, setting min_age to a maximum
of 2 (used to be 1) before calling object->regions->draw_boxes_in_image.

Changed bye_bye function in ConfigurationManager slightly (one less #else, exit
with code 0 not 1).


--------------------------------------------------------------------------------

Revision 1.23 for Linux2: nts on Tue Feb 25 18:34:42 GMT 2003
---final clean-up and check-in within the ADVISOR project---

RegionTracker::predict_old_objects did not set old_origin correctly when
predicting (wrong order of variable assignments).  Fix.

The RegionTracker::post_process_frame method used the wrong comparison for old
invisible regions (>= not <=) and hence did not keep invisible regions at all.
Fix.

Added newline in debug output in ActiveShapeTracker::track_old_objects method.

In Calibration class, corrected the handling of image addressing in
Calibration::get_ip_from_world method; the return value is now adjusted to fit
Image::image_addressing_mode.  In the
Calibration::get_image_distance_from_height_in_cm method, using
Calibration::get_ip_from_world instead of an explicit formula (which assumed a
particular image addressing mode).  Added some comments to existing code in
Calibration methods and renamed some variables for better readability.

Initialise member variable xml_frame_id to 0 in RegionSet::RegionSet.

Delete image_buffer in BufferedSlaveImageSource::~BufferedSlaveImageSource.

Added an assertion (data consistency check in a profile) in the
ActiveShapeTracker::create_hypotheses_using_calibration method.

In the Camera class, removed #ifdef DEBUG around references to the output_movie
variable (used to exist only in DEBUG mode).

Moved member and configuration variables colour_edge_back_threshold and
colour_edge_diff_threshold from the BaseTracker class into SkeletonTracker.
They were not used anywhere else (although this was planned at some point).

Removed member variable Profile::time_alive which counts frames.
frame_last_detected - frame_first_detected should be the same number (but for
some odd reason, it was not.  This was fixed.)

Renamed a variable in the ActiveShapeTracker::post_process_frame method for
better readability.

Made static bool ConfigurationManager::have_done `volatile' because it is.

Declared the values of configuration variables in/connected with the
ConfigurationManager class as `volatile', changed calling methods accordingly.
An exception are all strings and filenames which were kept (problems with other
code).

Removed some unnecessary type casts from calls to
ConfigurationManager::register_... methods.

Ignore background objects when looking for duplicate profiles in the
ActiveShapeTracker::post_process_frame method (used to be commented out).

Do not destroy tracked objects in the ActiveShapeTracker::post_process_frame
method when we have removed the last profile.  This is done using the
TrackedObjectSet::remove_old_tracks method from the Camera class.

Re-ordered cleanup procedures in the ActiveShapeTracker::post_process_frame
method.  Now objects are split before cleaning up objects which correspond to
the same person.

In the RegionTracker::post_process_frame method, clean away new objects which
are contained completely within a profile (noise in the motion image!)

Added some forward declarations in some header files, including other include
files in the implementation (.cc) file.

In ProfileSet::draw_in_image method, changed the comparison to min_age from >
to >=.

In the ProfileSet class, moved things from the implementation (.cc) file to the
header (.h) file and the other way around.

In the Profile::draw_in_image method, removed unused handling of region data
which used to be stored in a Profile for initial PETS 2001 experiments.

Removed code to clean away old unmatched objects in the
RegionTracker::post_process_frame method.  This is done using the
TrackedObjectSet::remove_old_tracks method from the Camera class.  Moved the
MAX_KEEP_ALIVE configuration parameter from RegionTracker to Camera.  It
determined how long to keep unseen (predicted) objects before removing them
from the tracked object database.

New method ScreenOutput::draw_motion_data to draw the motion detection output
into the motion image before running the RegionTracker.  This method is called
by Camera::do_processing.  Removed the motion data drawing functionality from
the ScreenOutput::draw_results method.

The MovieStore class can now handle PNM (PPM/PGM) output, using the
Image:save_pnm method for writing the file.

Improved drawing of polygon approximation to the b-spline outline in the
Profile::draw(int col1, int col2, int col3) method.

In ConfigurationManager::parse_parameter_file method, corrected a check whether
the configuration file was opened OK.

Added #ifdef NO_DISPLAY statements in ImageSource::display,
ImageSource::set_title, BufferedSlaveImageSource::keep_image_memory_for_later,
BufferedSlaveImageSource::get_next and MotionDetector::MotionDetector methods.

#ifndef NO_DISPLAY then #include "strcasecmp.h" in ConfigurationManager.cc.

In text_output.h, changed return types of methods in nop_ostream class to from
ostream to nop_ostream such that repeated calls (e.g. cdebug << 1 << 2) work.

Added nop_ostream &nop_ostream::operator<<(__omanip func) and nop_ostream
&nop_ostream::operator<<(__manip func) to nop_ostream class in text_output.h
The new methods do not do anything.  This fixes a bug with the nop_ostream
class which was there because these methods were used but not overloaded by us.

#ifdef ADVISOR around error messages in Tracking class when no external motion
data is available.

Made PeopleTracker::do_processing exit when all cameras are disabled (e.g. end
of sequence).

Removed the experimental and unfinished SkeletonTracker and its data components
(like Skeleton and SkeletonSet classes) from The Code.

Removed some unused accessors and modifiers from the Tracking class.


--------------------------------------------------------------------------------

Revision 1.24 for Linux2: nts on Tue Apr 29 17:26:24 BST 2003

Added copyright notice for publication of the code under the GPL according to
the updated file COPYRIGHT.  Added GPL.txt (original from the FSF) and a file
HISTORY which briefly explains the Code's history.  Added copyright notice to
2 of the main programs.  (The other ones are only test cases and old programs
which are no longer maintained anyway.)

--------------------------------------------------------------------------------

Revision 1.25 for Linux2: nts on Tue Apr 29 17:33:25 BST 2003

Updated README file, removed special README.Thales file for Thales.

--------------------------------------------------------------------------------

Revision 1.26 for Linux2: nts on Fri Jan 28 20:13:05 CET 2005

-- This release does not feature any new or changed tracking algorithms, except
-- possibly where a bugfix has had a positive influence on performance.

-- This release incorporates bugfixes and small changes by Samuel Audet `(sa)'

Changed code to adhere more closely to ISO C99.  This also means that in some
cases, using namespaces could not be nicely avoided.  Anyway, it is 2004 so
everybody should have a reasonable C++ compiler with working namespaces at her
disposal.

Hence, added some namespace references wherever necessary, especially for the
XML code which uses the new Xerces CPP Namespace in newer versions of XML4C and
Xerces-C.

In operators nop_ostream &nop_ostream::operator<<(__omanip func) and
nop_ostream &nop_ostream::operator<<(__manip func), changed types __manip and
__omanip to their explicit types.  This was necessary because newer versions of
the GNU ISO C library do not define the types.

Introduced new Image::check_coords(realno x, realno y) and
Image::check_coords(unsigned int x, unsigned int y) methods.  The first one
rounds to nearest int and returns Image::check_coords(int x, int y).

Similarly, added Image::draw_line(...) with realno interface which calls the
one that uses int types.

Similar wrappers for realno arguments to 2 methods in OcclusionHandler.h

Changed format of help_callback function in ConfigurationManager.cc (now uses
void *, not char * for second argument).  Also, added the & in call to
XtAddCallback(toggle, XmNhelpCallback, &help_callback, help_string) to make
the conversion explicit.  Added some explicit type casts in this module.

In ConfigurationManager class, made some more functions and variables static
members.

In the ConfigurationManager::word_wrap_string method, changed the use of
ifstream and ofstream to use the stringbuf type instead; new parsing.

Changed some types in EdgeDetector to avoid implicit casts.

Made some type casts in EdgeDetector and other code from int to float explicit
before calling the sqrt function.

Changed Makefile variable TMP_HOME to BIN_HOME because it is more appropriate.

Updated Windows README file README.Windows (newly created from an earlier
version which was created for Thales in 2002).

Changed the HumanFeatures constructor to provide data_source parameter to base
class Observation's constructor.

Added 1 in calculation of width and height in Profile::update_size_variables().

Changed default values of width and height variables in Observation to 1.

In the Region.cc file, moved the const start_list, end_list and directions
arrays into the Region class.

Changed some old-style C system includes (e.g. include <math.h>) into their
"new" C++ equivalents (e.g. include <cmath>).

Bugfix from Hongliang Bai <baihl@hanwang.com.cn>: changed references to
variable rel_scale_sd to noise_scale_sd in ActiveModel and ActiveShapeTracker
classes.  Removed rel_scale_sd variable in ActiveShapeTracker class.

Added a few explicit casts in some classes where implicit casts had been made
by generous compilers in the past.

Changed usage of guchar and gint types in IEEE1394Source class to C++ standard
types, for use with newer versions of libdv.

Removed a few duplicate statements of default values to parameters in a few
methods, in .cc files.  Default values in .h files left unchanged.

Removed unused method PeopleTracker::write_results_in_XML_to_buffer which was
not nice to implement with the new <sstream>'s ostringstream class (and
 therefore not functioning as intended) anyway.

In PeopleTracker::PeopleTracker(char *toplevel_config_filename), the local
variable start_time shadowed the member variable.  Removed declaration.

Added a method check_class_invariants() in Observation class which checks the
class invariants (sic!).  Currently it is not referenced.

Some beautifications in RegionSet and other classes.

Moved some static variables that hid from earlier searches into a class, in
this case RGB32Image.

Examined and changed the code in NagMatrix, especially the BLAS/LAPACK code.
This should make it much more readable and hopefully fixed some problems that
existed.

New HAVE_MIN_MAX compile-time define that specifies whether the ISO C99 min and
max functions are available.  Otherwise they will be defined in
utils/tracker_defines_types_and_helpers.h .

Made a few minor user interface changes to NagMatrix_test.cc .

Added some assertions and improved comments for existing assertions in a
number of modules.

Made some methods inline and/or const where this improves the code.

Removed some unused variables in a number of files.

Removed some unused, commented out code.

Removed old, unused file imgsrc_utils.cc and its header imgsrc_utils.h.

A NagVector initialised with (values from) a NagMatrix now allocates its own
memory even if the NagMatrix does not have its own.  This is to make code more
safe.

Removed obsolete boolean.h file, HAVE_BOOL compiler define (and references to)
since bool is a proper type in ISO C++.

Changed occurances of the string "color" to "colour" in our own variable
names for consistency.  This also has the advantage that external GL functions
can be recognised by their American spelling...

Renamed draw_colour variable in the Profile and HumanFeatureTracker classes to
draw_in_colour so that it is now mixed up with variables specifying a colour.

Made some member variables private in the OcclusionImage class.

Added a copy constructor for the Grey8Image class to avoid uninitialised
variables.

$(BIN_HOME) is now created whenever used in case it is needed and does not exist.

Made Image *Image::copy method const.

Separated KalmanFilter files into KalmanFilterOneD and KalmanFilterTwoD files.
This reduces the file sizes.

Cleaned up the generic.mk Makefile for better readability and easier
configuration.

Changed our use of an XML library.  XML4C has been discontinued by IBM,
therefore we use Apache's Xerces-C library (available from
http://xml.apache.org/xerces-c/ ).  The changeover was easy because XML4C is
based on Xerces-C.  Also, Apache provides pre-compiled libraries and includes
in a single tar file :-)


(sa) Moved all the code into the "ReadingPeopleTracker" namespace. This
resolves a conflict between "class Region" and "typedef struct _XRegion
*Region" in X11's include files.

(sa) changed in NagVector.h:
  - removed "const" return from "const realno &operator[](unsigned int i) const"
  - added "const realno *get_data_const() const { return data; }"

(sa) changed in NagMatrix.h:
  - added "const realno *get_data_const() const { return data; }"

(sa) changed in NagVector.cc:
  - get_data() -> get_data_const() where needed
  - for accesses to NagMatrix: rows -> no_rows(), 
    data -> get_data(), columns -> no_columns()

(sa) changed in NagMatrix.cc: 
  - for accesses to NagVector: size -> get_size(),
    data -> get_data()/get_data_const()
  - checked LAPACK implementation of solve_equation() and removed #error
  - added warnings when using get_eigensystem() and sv_decompose() with LAPACK,
    since they do not seem to return valid results
    
(sa) changed in KalmanFilter.cc
  - normal_random() -> NagVector::normal_random()
  - commented out "#ifndef WIN32 inline  #endif
   
(sa) changed in ConfigurationManager.cc:  
  - replaced #include "strcasecmp.h" with #include "os_specific_things.h"
  - modified BoolConfigurationVariable::read_value() to make it safe on all 
    platforms since the size of a bool is undefined.

(sa) changed in Observation.h
  - added an empty destructor definition
   
(sa) changed in main Makefile:
  - progs -> progsdir, since "progs" is a directory, thus already built
    according to gmake, so we need to use another identifier.
     
(sa) changed in ScreenOutput.cc:  
  - in ScreenOutput::draw_results(), added "if (draw_profiles){
    object->dat->profiles->draw(min_draw_age);}" so we can see the profiles...
  - copied colour code in "show_video_images" to "draw_label" for correct label
    colouring

(sa) changed in RegionSet.cc:
  - Changed code in bbdistance() to computer "lo - hi" instead of "hi - lo".
    Gives better results this way, but don't forget to reduce 
    REGION_MERGE_THRESH by a factor or at least ten. Also changed 
    (dx + dy) / (d1 + d2 + 1) to (dx + dy/16) / (d1 + d2 + 1) in order for the 
    regions to have a greater tendency to merge vertically rather than 
    horizontally.  The use of floating point variables also increases precision.

(sa) changed in ActiveShapeTracker.cc:
  - changed "<" to "<=" because in extreme cases, the height might be 0, in
    assert((Image::image_addressing_mode == IA_TOP_TO_BOTTOM) ^ (feet[1] <= head[1]));
  - added configuration code block for uninitialized value of REL_ACC_SD    

(sa) changed in Calibration.cc:
  - assert(image_height > 0);  -> assert(the_image_height > 0);
  - moved "matrix_image_addressing_mode = Image::image_addressing_mode;"
    to before call to get_world_from_ip() in constructor

(sa) changed in PeopleTracker.cc:
  - delete camera_config_filename; -> delete [] camera_config_filename;
  - added "thread_id = 0;" to constructor
  - added "xml_tracking_results_filename = "";" before trying to display it 
    on cerror if NULL
  
(sa) changed in Region.h:
  - added "inv_grad = 0;" to constructor

(sa) changed in BufferedSlaveImageSource.cc:
  - for (buffer_index = buffer_size; buffer_index >= buffer_entries; buffer_index--) ->
    for (buffer_index = buffer_size-1; buffer_index >= buffer_entries; buffer_index--)

(sa) changed in JPEGSource.cc:
  - moved "new_frame_time_in_s = mktime(f_time);" into "if (have_valid_header)" block

(sa) changed in HumanFeatureTracker.cc:
  - "delete upper_reg_img;" after use

(sa) changed in Region.cc:
  - in merge() added "newimage->clear(0);" because the subregions do not cover 
    the whole newimage

(sa) changed in MedianFilterSource.cc:
  - added to constructor: "counts_red = current->copy_type(); nearest = current->copy_type();
    counts_red->clear(ZERO);"


--------------------------------------------------------------------------------

Revision 1.27 for Linux2: nts on Fri Jan 28 21:15:13 CET 2005


Created a new official website where the Reading People Tracker lives.  It has
the source code, documentation and release notes:
http://www.siebel-research.de/people_tracking/reading_people_tracker/

Added a reference to the website to the file README.

Changed documentation/references from XML4C to Xerces-C.

Improved the distclean target in the main Makefile.


--------------------------------------------------------------------------------

Revision 1.28 for Linux2: nts on Tue Nov 29 10:33:33 CET 2005

Removed unused dummy files tracking/HumanFeatureTracker-empty.cc and
tracking/RegionTracker-empty.cc 

Updated the README file, among other things to include references to Ygl and
IEEE1394 libraries.

Changed friend declaration in Profile class and Fortran library name in
generic.mk in order to achieve compatibility with gcc version 4.x

Added check for gcc 4.x or gcc 3.x in generic.mk because with 4.x the Fortran
libraries have been renamed by GNU.  Setting of MATH_LIBS variable is now done
according to the gcc major version.

Removed C (not C++) compilation options -Wstrict-prototypes
-Wmissing-prototypes in generic.mk

Small changes of comments and other text (non-functional changes).

In the implementation of the Camera class tracking->get_active_shape_tracker()
was accessed to test the debug_level even when the object did not exist (and
the pointer was NULL).  Fix.

Added assertion on camera_object_ptr in Camera::start_processing().

Changed comments/output in HumanFeatureTracker because it looked as if
functionality was missing (when it is not!).

Made a few methods const in the Tracking class.

Simplified calls to internal methods in IEEE1394Adaptor, using already existing
member variables instead of function parameters.

Changed some names of function parameters where member variables were shadowed.

Increased size of statistics variable in HumanFeatureTracker class (now region
width is assumed to be <= 2048 pixels).

Some other small changes.


--------------------------------------------------------------------------------



--------------------------------------------------------------------------------



--------------------------------------------------------------------------------



--------------------------------------------------------------------------------





This is a file local dictionary for our spell checker `ispell'.  Please ignore.

 LocalWords:  ConfigurationManager GlobalsManager RegionSet PipeSource nts Amb
 LocalWords:  chmod utils AmbGlobals AmbErrorHandler ErrorHandler LPT progs Ygl
 LocalWords:  ifdef moviestore sgmoviestore MovieStore imgsrc moviesrc HDRS mk
 LocalWords:  SRCS libis cpack SRC TMP ifndef ostream ENDIAN struct PS
 LocalWords:  DMONOCHROME BWImage JPEGSource ImageSource JCS motionfile Dgl ok
 LocalWords:  MotionDetector PgmSource gzip zcat inline getdisplaymode RGBcolor
 LocalWords:  TrueColour color DUSE ActiveModel bool jpg stderr cvsignore GP NB
 LocalWords:  xml XMLSource XMLInit DOMTreeErrorReporter xmlfile rm cvs bugfix
 LocalWords:  JPEGydim endl GrayMap qxw XMLHeader XMLSequence XMLBlob enum kB
 LocalWords:  DifferenceSource ThresholdedDifferenceSource ColourFilter msec pg
 LocalWords:  ColourFilteringMethod EnvParameter ProfileSequence config DDEBUG
 LocalWords:  PeopleTracker HumanFeatureTracker WorldOcclusionHandler cerr cout
 LocalWords:  GroundPeopleTracker FeatureDetector EdgeDetector const pnm pte rb
 LocalWords:  YUV SkeletonTracker XMLWriter xsd xmlwrite recalc PnmSource libc
 LocalWords:  miscsrcs SkipSource libstdc ImageSource's vidsrc Xt RegionTracker
 LocalWords:  DNO BWImage's OcclusionImage BaseTracker ShapeTracker SkeletonSet
 LocalWords:  HumanFeatureSet TrackerManagementProgram incam libXMLSource ptest
 LocalWords:  libXML TrackedObjectList TrackedObjectSet RegionTrack listtest bz
 LocalWords:  TrackedObject TrackedProfile TrackedProfileSet mpeg amb vogl if's
 LocalWords:  FixHoleSource imgfnct GREYsrc testmatrix PointVector HeadInfoType
 LocalWords:  HumanFeatures BoundaryPoints ColourBlob NagVector's NDEBUG medsrc
 LocalWords:  NagVector NagMatrix MovieSource MedianFilterSource diffsrc MOVI
 LocalWords:  RGBpixel heirarch ProfileSet pca memcpy BufferedSlaveImageSource
 LocalWords:  ActiveShapeTracker PnmStream XMLRegionSource DLSB DMSB endianness
 LocalWords:  BufferedSlaveXMLRegionSource GroundPlaneToImagePlane GPfilter int
 LocalWords:  ProActiveModel HMetric MathRoutines SplineWeights bspline SVID xw
 LocalWords:  SplineMatrix cinfo cdebug cerror ostream's printf fprintf egetopt
 LocalWords:  realno PolyFilter Ponsa Dani ReadingPeopleTracker constness eg os
 LocalWords:  NumberedFiles strncasecmp strcasecmp UCB iff define's libiberty
 LocalWords:  egcs gccdev astaff athena afs edu mit EnvIntParameter typedef's
 LocalWords:  int's int's CameraConfiguration LSB MSB Makefile's num STDC MKL
 LocalWords:  mkl tl usleep unistd NumberedFileSource ScreenOutput ListMatrix
 LocalWords:  ForegroundEdgeDetector ImageType imgtype sl DV libdv libraw RGB
 LocalWords:  librom libavc Camcorder wrapperstream cpp ptinterface ptwrapper
 LocalWords:  dataflow setlinestyle nop XtAddCallback Rmi jpegproblems refimg
 LocalWords:  XMLRegionHandler BasePixel GreyPixel ImagePyramid camcorder aka
 LocalWords:  ColouredForegroundEdgeDetector ColourForegroundEdgeDetector xdim
 LocalWords:  ColouredEdgeDetector ColourEdgeDetector NormForeColourDetect GPL
 LocalWords:  NormalisedColourForegroundEdgeDetector SobelDetector RepeatSource
 LocalWords:  SobelEdgeDetector PipeSourceFilters BSPLINES precalculated alloc
 LocalWords:  PRECALCULATE OcclusionHandler userdata STACKSIZE ImageAddressing
 LocalWords:  qsort istream omanip manip XmNhelpCallback Observation's cmath
 LocalWords:  cassert ifstream ofstream stringbuf
