X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=mtp.cc;h=5feb2bef5c01a4d0fc544aa2b6a5ee1ae666daad;hb=9ea42c9da6b7863a0bcfd49e20c151900c04c8ef;hp=957e56f997a7241d16a30df1ebda021ab80615a6;hpb=f419bacb4b11f42f87e6e9bc9e8a4719499559f2;p=mtp.git diff --git a/mtp.cc b/mtp.cc index 957e56f..5feb2be 100644 --- a/mtp.cc +++ b/mtp.cc @@ -40,6 +40,14 @@ int verbose; void usage(ostream *os) { (*os) << "mtp [-h|--help] [-v|--verbose] [-t|--trajectory-filename ] [-g|--graph-filename ] []" << endl; + (*os) << endl; + (*os) << "The mtp command processes a file containing the description of a topology" << endl; + (*os) << "and detection scores, and prints the optimal set of trajectories." << endl; + (*os) << "If no filename is provided, it will read the parameters from the stdin." << endl; + (*os) << "If no trajectory filename is provided, it will write the result to" << endl; + (*os) << "stdout." << endl; + (*os) << endl; + (*os) << "Written by Francois Fleuret. (C) Idiap Research Institute, 2012." << endl; } scalar_t diff_in_second(struct timeval *start, struct timeval *end) { @@ -55,17 +63,25 @@ void do_tracking(istream *in_tracker) { if(verbose) { cout << "Reading the tracking parameters." << endl; } tracker->read(in_tracker); - if(verbose) { cout << "Building the graph ... "; cout.flush(); } - gettimeofday(&start_time, 0); + if(verbose) { + cout << "Building the graph ... "; cout.flush(); + gettimeofday(&start_time, 0); + } tracker->build_graph(); - gettimeofday(&end_time, 0); - if(verbose) { cout << "done (" << diff_in_second(&start_time, &end_time) << "s)." << endl; } + if(verbose) { + gettimeofday(&end_time, 0); + cout << "done (" << diff_in_second(&start_time, &end_time) << "s)." << endl; + } - if(verbose) { cout << "Tracking ... "; cout.flush(); } - gettimeofday(&start_time, 0); + if(verbose) { + cout << "Tracking ... "; cout.flush(); + gettimeofday(&start_time, 0); + } tracker->track(); - gettimeofday(&end_time, 0); - if(verbose) { cout << "done (" << diff_in_second(&start_time, &end_time) << "s)." << endl; } + if(verbose) { + gettimeofday(&end_time, 0); + cout << "done (" << diff_in_second(&start_time, &end_time) << "s)." << endl; + } if(strcmp(trajectory_filename, "")) { ofstream out_traj(trajectory_filename); @@ -96,7 +112,6 @@ int main(int argc, char **argv) { int c; int error = 0, show_help = 0; - // strncpy(trajectory_filename, "result.trj", FILENAME_SIZE); strncpy(trajectory_filename, "", FILENAME_SIZE); strncpy(graph_filename, "", FILENAME_SIZE); verbose = 0;