- - the allowed motions between them (i.e. a Boolean flag for each
- pair of locations)
- - the entrances (a Boolean flag for each location)
- - the exits (a Boolean flag for each location)
-
- (2) to define a number of time steps
-
- (3) to set for every location and time a detection score, which
- should be equal to log(P(Y = 1 | X)/P(Y = 0 | X)) where Y stands for
- the location occupancy and X for the observations.
-
-From this setting, it computes the best set of disjoint trajectories
-consistent with the topology, which maximizes the overall detection
-score (i.e. the sum of the detection scores of the nodes visited by
-the trajectories)
-
-The Tracker class uses the MTPGraph. From the definition of the
-spatial topology, it builds a graph with one source, one sink, and two
-nodes per location and time. This structure ensures the trajectories
-computed by the tracker to be node-disjoint by forcing the paths
-computed by the MTPGraph to be edge-disjoint. The edges from the
-source or to the sink, or between these pairs, are of length zero, and
-the edge between the two nodes of such a pair has a length equal to
-the opposite of the detection score.
-
-The file mtp.cc gives a very simple usage example of the Tracker
-class.
+
+ - the allowed motions between them (a Boolean flag for each pair
+ of locations from/to)
+
+ - the entrances (a Boolean flag for each location and time step)
+
+ - the exits (a Boolean flag for each location and time step)
+
+ (2) a number of time steps
+
+ (3) a detection score for every location and time, which stands for
+
+ log( P(Y(l,t) = 1 | X) / P(Y(l,t) = 0 | X) )
+
+ where Y is the occupancy of location l at time t and X is the
+ available observation. Hence, this score is negative on locations
+ where the probability that the location is occupied is close to
+ 0, and positive when it is close to 1.
+
+From this parameters, an MTPTracker can compute the best set of
+disjoint trajectories consistent with the defined topology, which
+maximizes the overall detection score (i.e. the sum of the detection
+scores of the nodes visited by the trajectories). In particular, if no
+trajectory of total positive detection score exists, this optimal set
+of trajectories is empty.
+
+An MTPTracker is a wrapper around an MTPGraph. From the defined
+spatial topology and number of time steps, it builds a graph with one
+source, one sink, and two nodes per location and time. The edges from
+the source or to the sink, or between these pairs of nodes, are of
+length zero, and the edges between the two nodes of such a pair have
+negative lengths, equal to the opposite of the corresponding detection
+scores. This structure ensures that the trajectories computed by the
+MTPTracker will be node-disjoint, since the trajectories computed by
+the MTPGraph are edge-disjoint.
+
+The file mtp_example.cc gives a very simple usage example of the
+MTPTracker class by setting the tracker parameters dynamically, and
+running the tracking.
+
+The tracker data file for MTPTracker::read has the following format,
+where L is the number of locations and T is the number of time steps:
+
+---------------------------- snip snip -------------------------------
+ int:L int:T
+
+ bool:allowed_motion_from_1_to_1 ... bool:allowed_motion_from_1_to_L
+ ...
+ bool:allowed_motion_from_L_to_1 ... bool:allowed_motion_from_L_to_L
+
+ bool:entrance_1_1 ... bool:entrance_1_L
+ ...
+ bool:entrance_T_1 ... bool:entrance_T_L
+
+ bool:exit_1_1 ... bool:exit_1_L
+ ...
+ bool:exit_T_1 ... bool:exit_T_L
+
+ float:detection_score_1_1 ... float:detection_score_1_L
+ ...
+ float:detection_score_T_1 ... float:detection_score_T_L
+---------------------------- snip snip -------------------------------
+
+The method MTPTracker::write_trajectories writes first the number of
+trajectories, followed by one line per trajectory with the following
+structure
+
+---------------------------- snip snip -------------------------------
+ int:traj_number int:entrance_time int:duration float:score int:location_1 ... int:location_duration
+---------------------------- snip snip -------------------------------