Mercurial > hg > nsaunier > traffic-intelligence
comparison c/feature-based-tracking.cpp @ 166:4eb13ed73d84
tests on reading and printing trajectories from database
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 29 Sep 2011 18:49:40 -0400 |
| parents | 50964af05a80 |
| children | ed2de414e5f6 |
comparison
equal
deleted
inserted
replaced
| 165:50964af05a80 | 166:4eb13ed73d84 |
|---|---|
| 15 | 15 |
| 16 #include <boost/shared_ptr.hpp> | 16 #include <boost/shared_ptr.hpp> |
| 17 #include <boost/foreach.hpp> | 17 #include <boost/foreach.hpp> |
| 18 | 18 |
| 19 #include <iostream> | 19 #include <iostream> |
| 20 //#include <list> | |
| 21 #include <vector> | 20 #include <vector> |
| 22 | 21 |
| 23 using namespace std; | 22 using namespace std; |
| 24 using namespace cv; | 23 using namespace cv; |
| 25 | 24 |
| 256 bool success = trajectoryDB->connect(params.databaseFilename.c_str()); | 255 bool success = trajectoryDB->connect(params.databaseFilename.c_str()); |
| 257 vector<boost::shared_ptr<Trajectory<Point2f> > > trajectories; | 256 vector<boost::shared_ptr<Trajectory<Point2f> > > trajectories; |
| 258 cout << trajectories.size() << endl; | 257 cout << trajectories.size() << endl; |
| 259 success = trajectoryDB->read(trajectories, "positions"); | 258 success = trajectoryDB->read(trajectories, "positions"); |
| 260 cout << trajectories.size() << endl; | 259 cout << trajectories.size() << endl; |
| 261 cout << trajectories[0]->size() << endl; | 260 for (int i=0; i<5; ++i) { |
| 262 //cout << trajectories[0]->getPoint(0) << endl; | 261 stringstream ss; |
| 262 ss << *trajectories[i]; | |
| 263 cout << ss.str() << endl; | |
| 264 } | |
| 263 trajectoryDB->endTransaction(); | 265 trajectoryDB->endTransaction(); |
| 264 trajectoryDB->disconnect(); | 266 trajectoryDB->disconnect(); |
| 265 } | 267 } |
| 266 | 268 |
| 267 return 0; | 269 return 0; |
