#include <iostream>
#include <fstream>
+#include <stdlib.h>
using namespace std;
// any location less than motion_amplitude away, entrance at
// location 0 (or in the first time frame, i.e. targets can already
// be in the scene when the sequence starts) and exit at location
- // nb_locations-1 (or from the last time frame, i.e. target can
+ // nb_locations-1 (or from the last time frame, i.e. targets can
// still be present when the sequence finishes)
for(int l = 0; l < nb_locations; l++) {
for(int m = 0; m < nb_locations; m++) {
- tracker->allowed_motion[l][m] = abs(l - m) <= motion_amplitude;
+ tracker->allowed_motions[l][m] = abs(l - m) <= motion_amplitude;
}
}
delete[] _edge_lengths;
delete _graph;
deallocate_array<scalar_t>(detection_scores);
- deallocate_array<int>(allowed_motion);
+ deallocate_array<int>(allowed_motions);
deallocate_array<int>(exits);
deallocate_array<int>(entrances);
}
nb_time_steps = t;
detection_scores = allocate_array<scalar_t>(nb_time_steps, nb_locations);
- allowed_motion = allocate_array<int>(nb_locations, nb_locations);
+ allowed_motions = allocate_array<int>(nb_locations, nb_locations);
entrances = allocate_array<int>(nb_time_steps, nb_locations);
exits = allocate_array<int>(nb_time_steps, nb_locations);
for(int l = 0; l < nb_locations; l++) {
for(int m = 0; m < nb_locations; m++) {
- allowed_motion[l][m] = 0;
+ allowed_motions[l][m] = 0;
}
}
for(int l = 0; l < nb_locations; l++) {
for(int m = 0; m < nb_locations; m++) {
- (*os) << allowed_motion[l][m];
+ (*os) << allowed_motions[l][m];
if(m < nb_locations - 1) (*os) << " "; else (*os) << endl;
}
}
for(int l = 0; l < nb_locations; l++) {
for(int m = 0; m < nb_locations; m++) {
- (*is) >> allowed_motion[l][m];
+ (*is) >> allowed_motions[l][m];
}
}
nb_time_steps = 0;
detection_scores = 0;
- allowed_motion = 0;
+ allowed_motions = 0;
entrances = 0;
exits = 0;
delete[] _edge_lengths;
delete _graph;
deallocate_array<scalar_t>(detection_scores);
- deallocate_array<int>(allowed_motion);
+ deallocate_array<int>(allowed_motions);
deallocate_array<int>(entrances);
deallocate_array<int>(exits);
}
if(entrances[t][l]) nb_entrances++;
}
for(int m = 0; m < nb_locations; m++) {
- if(allowed_motion[l][m]) nb_motions++;
+ if(allowed_motions[l][m]) nb_motions++;
}
}
for(int t = 0; t < nb_time_steps - 1; t++) {
for(int l = 0; l < nb_locations; l++) {
for(int k = 0; k < nb_locations; k++) {
- if(allowed_motion[l][k]) {
+ if(allowed_motions[l][k]) {
node_from[e] = late_pair_node(t, l);
node_to[e] = early_pair_node(t+1, k);
_edge_lengths[e] = 0.0;