* INSTALLATION
-This source code should compile with any C++ compiler. Just run "make"
-and execute the mtp executable. It should print the optimal detected
-trajectories, and save into graph.dot the result graph and
-trajectories in the dot syntax. You can produce a pdf from the latter
-with
+This source code should compile with any C++ compiler. Just execute
+
+ make
+ ./mtp_example
+
+It will create a synthetic dummy example, save its description in
+tracker.dat, and print the optimal detected trajectories.
+
+If you now execute
+
+ ./mtp tracker.dat
+
+It will load the tracker.dat example, run the detection, save the
+detected trajectories in result.trj, and the underlying graph with
+occupied edges in graph.dot. You can produce a pdf from the latter
+with the dot command from graphviz:
dot < graph.dot -T pdf -o graph.pdf
-* DESCRIPTION
+* IMPLEMENTATION
The two main classes are MTPGraph and Tracker.
exit(EXIT_FAILURE);
}
- Tracker tracker;
+ ifstream *in_tracker = new ifstream(argv[1]);
- ifstream in_tracker(argv[1]);
+ if(in_tracker->good()) {
- if(in_tracker.good()) {
+ Tracker *tracker = new Tracker();
- tracker.read(&in_tracker);
- tracker.build_graph();
- tracker.track();
+ tracker->read(in_tracker);
+ tracker->build_graph();
+ tracker->track();
cout << "Read " << argv[1] << endl;
ofstream out_traj("result.trj");
- tracker.write_trajectories(&out_traj);
+ tracker->write_trajectories(&out_traj);
cout << "Wrote result.trj" << endl;
ofstream out_dot("graph.dot");
- tracker.print_graph_dot(&out_dot);
+ tracker->print_graph_dot(&out_dot);
cout << "Wrote graph.dot" << endl;
+ delete tracker;
+
} else {
cerr << "Can not open " << argv[1] << endl;
}
+ delete in_tracker;
+
exit(EXIT_SUCCESS);
}
tracker->detection_scores[t][lb] = sb;
}
- // Does the tracking per se
+ { // Write down the tracker setting
+ ofstream out_tracker("tracker.dat");
+ tracker->write(&out_tracker);
+ }
- ofstream out_tracker("tracker.dat");
- tracker->write(&out_tracker);
+ // Does the tracking per se
tracker->track();