Mercurial Hosting > traffic-intelligence
changeset 172:e508bb0cbb64
modified comments
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 25 Oct 2011 19:01:21 -0400 |
parents | 8e7b354666ec |
children | 319a04ba9033 |
files | c/feature-based-tracking.cpp |
diffstat | 1 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/c/feature-based-tracking.cpp Mon Oct 17 14:16:50 2011 -0400 +++ b/c/feature-based-tracking.cpp Tue Oct 25 19:01:21 2011 -0400 @@ -245,7 +245,7 @@ bool success = trajectoryDB->connect(params.databaseFilename.c_str()); vector<boost::shared_ptr<Trajectory<Point2f> > > trajectories; cout << trajectories.size() << endl; - success = trajectoryDB->read(trajectories, "positions"); // TODO load velocities as well + success = trajectoryDB->read(trajectories, "positions"); // TODO load velocities as well in a FeatureTrajectory object // attention, velocities lack the first instant cout << "Loaded " << trajectories.size() << " trajectories" << endl; // for (int i=0; i<5; ++i) { // stringstream ss; @@ -253,11 +253,6 @@ // cout << ss.str() << endl; // } - // create views for first and last instants for each trajectory - // CREATE VIEW IF NOT EXISTS trajectory_first_instants AS select trajectory_id, min(frame_number) as first_instant from positions group by trajectory_id - // CREATE VIEW IF NOT EXISTS trajectory_last_instants AS select trajectory_id, max(frame_number) as last_instant from positions group by trajectory_id - //select trajectory_id from trajectory_first_instants where first_instant = 49 - trajectoryDB->createViewInstants("first"); trajectoryDB->createViewInstants("last"); @@ -266,9 +261,13 @@ for (int frameNum = params.frame1; ((frameNum-params.frame1 < params.nFrames) || (params.nFrames < 0)); frameNum++) { vector<int> ids; cout << "frame " << frameNum << " " << trajectoryDB->trajectoryIdStartingAt(ids, frameNum) << endl; + cout << ids.size() << ": "; BOOST_FOREACH(int i, ids) cout << i << " "; cout << endl; + + // should the trajectory be loaded one by one? yes + } trajectoryDB->endTransaction();