Mercurial Hosting > traffic-intelligence
comparison include/Motion.hpp @ 147:0089fb29cd26
added projection of points and reprojection for display
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 30 Aug 2011 13:38:31 -0400 |
parents | a3532db00c28 |
children | cde87a07eb58 |
comparison
equal
deleted
inserted
replaced
146:7150427c665e | 147:0089fb29cd26 |
---|---|
10 /** Class for feature data | 10 /** Class for feature data |
11 positions, velocities and other statistics to evaluate their quality | 11 positions, velocities and other statistics to evaluate their quality |
12 before saving. */ | 12 before saving. */ |
13 class FeatureTrajectory { | 13 class FeatureTrajectory { |
14 public: | 14 public: |
15 FeatureTrajectory(const int& frameNum, const cv::Point2f& p); | 15 FeatureTrajectory(const int& frameNum, const cv::Point2f& p, const cv::Mat& homography); |
16 | 16 |
17 unsigned int length(void) const { return positions.size();} | 17 unsigned int length(void) const { return positions.size();} |
18 | 18 |
19 void setId(const unsigned int& id) { positions.setId(id);velocities.setId(id);} | 19 void setId(const unsigned int& id) { positions.setId(id);velocities.setId(id);} |
20 | 20 |
22 bool smallDisplacement(const unsigned int& nDisplacements, const float& minTotalFeatureDisplacement) const; | 22 bool smallDisplacement(const unsigned int& nDisplacements, const float& minTotalFeatureDisplacement) const; |
23 | 23 |
24 /// indicates whether the last two displacements are smooth (limited acceleration and angle) | 24 /// indicates whether the last two displacements are smooth (limited acceleration and angle) |
25 bool motionSmooth(const int& accelerationBound, const int& deviationBound) const; | 25 bool motionSmooth(const int& accelerationBound, const int& deviationBound) const; |
26 | 26 |
27 void addPoint(const int& frameNum, const cv::Point2f& p); | 27 void addPoint(const int& frameNum, const cv::Point2f& p, const cv::Mat& homography); |
28 | 28 |
29 void shorten(void); | 29 void shorten(void); |
30 | 30 |
31 void write(TrajectoryDBAccess<cv::Point2f>& trajectoryDB, const string& positionsTableName, const string& velocitiesTableName) const; | 31 void write(TrajectoryDBAccess<cv::Point2f>& trajectoryDB, const string& positionsTableName, const string& velocitiesTableName) const; |
32 | 32 |
33 #ifdef USE_OPENCV | 33 #ifdef USE_OPENCV |
34 void draw(cv::Mat& img, const cv::Scalar& color) const; | 34 void draw(cv::Mat& img, const cv::Mat& homography, const cv::Scalar& color) const; |
35 #endif | 35 #endif |
36 | 36 |
37 protected: | 37 protected: |
38 Trajectory<cv::Point2f> positions; | 38 Trajectory<cv::Point2f> positions; |
39 /** one fewer velocity than position | 39 /** one fewer velocity than position |