Mercurial Hosting > traffic-intelligence
diff c/feature-based-tracking.cpp @ 179:4f10e97cb677
added getting first and last instant for each feature
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 31 Oct 2011 19:17:42 -0400 |
parents | d7df8ecf5ccd |
children | 3a4eef37384f |
line wrap: on
line diff
--- a/c/feature-based-tracking.cpp Mon Oct 31 00:35:34 2011 -0400 +++ b/c/feature-based-tracking.cpp Mon Oct 31 19:17:42 2011 -0400 @@ -273,7 +273,7 @@ // TODO version que l'on peut interrompre ? for (int frameNum = params.frame1; ((frameNum-params.frame1 < params.nFrames) || (params.nFrames < 0)); frameNum++) { vector<int> trajectoryIds; - success = trajectoryDB->trajectoryIdStartingAt(trajectoryIds, frameNum); + success = trajectoryDB->trajectoryIdStartingAt(trajectoryIds, frameNum); // ending cout << "frame " << frameNum << " " << success << endl; cout << trajectoryIds.size() << " trajectories " << endl; BOOST_FOREACH(int trajectoryId, trajectoryIds) { @@ -281,7 +281,8 @@ // boost::shared_ptr<Trajectory<cv::Point2f> > trajectory; // success = trajectoryDB->read(trajectory, trajectoryId, "positions"); // velocities FeatureTrajectoryPtr ft = FeatureTrajectoryPtr(new FeatureTrajectory(trajectoryId, *trajectoryDB, "positions", "velocities")); - //stringstream ss;ss << *ft; cout << ss.str() << endl; + stringstream ss;ss << *ft; cout << ss.str() << endl; + cout << ft->getFirstInstant() << " " << ft->getLastInstant() << endl; } // should the trajectory be loaded one by one? yes