Mercurial > hg > nsaunier > traffic-intelligence
comparison c/Feature.cpp @ 133:63dd4355b6d1
saving of feature positions in sqlite database
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 17 Aug 2011 22:26:01 -0400 |
| parents | 45c64e68053c |
| children | 32d2722d4028 |
comparison
equal
deleted
inserted
replaced
| 132:45c64e68053c | 133:63dd4355b6d1 |
|---|---|
| 1 #include "Feature.hpp" | 1 #include "Feature.hpp" |
| 2 | 2 |
| 3 #include "opencv2/core/core.hpp" | 3 #include "opencv2/core/core.hpp" |
| 4 #include "opencv2/highgui/highgui.hpp" | 4 #include "opencv2/highgui/highgui.hpp" |
| 5 | |
| 6 #include "src/TrajectoryDBAccessList.h" | |
| 5 | 7 |
| 6 using namespace std; | 8 using namespace std; |
| 7 using namespace cv; | 9 using namespace cv; |
| 8 | 10 |
| 9 FeatureTrajectory::FeatureTrajectory(const int& frameNum, const cv::Point2f& p) { | 11 FeatureTrajectory::FeatureTrajectory(const int& frameNum, const cv::Point2f& p) { |
| 11 } | 13 } |
| 12 | 14 |
| 13 void FeatureTrajectory::addPoint(const int& frameNum, const Point2f& p) { | 15 void FeatureTrajectory::addPoint(const int& frameNum, const Point2f& p) { |
| 14 positions.add(frameNum, p); | 16 positions.add(frameNum, p); |
| 15 computeMotionData(frameNum); | 17 computeMotionData(frameNum); |
| 18 } | |
| 19 | |
| 20 void FeatureTrajectory::write(TrajectoryDBAccess<Point2f>& trajectoryDB) const { | |
| 21 /// \todo save velocities | |
| 22 trajectoryDB.write(positions); | |
| 16 } | 23 } |
| 17 | 24 |
| 18 #ifdef USE_OPENCV | 25 #ifdef USE_OPENCV |
| 19 /// \todo add option for anti-aliased drawing, thickness | 26 /// \todo add option for anti-aliased drawing, thickness |
| 20 void FeatureTrajectory::draw(Mat& img, const Scalar& color) const { | 27 void FeatureTrajectory::draw(Mat& img, const Scalar& color) const { |
