Mercurial > hg > nsaunier > traffic-intelligence
comparison include/Motion.hpp @ 139:47329bd16cc0
cleaned code, added condition on smooth displacement
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 23 Aug 2011 13:14:47 -0400 |
| parents | c1b260b48d2a |
| children | a3532db00c28 |
comparison
equal
deleted
inserted
replaced
| 138:c1b260b48d2a | 139:47329bd16cc0 |
|---|---|
| 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 |
| 21 /// indicates whether the sum of the last nDisplacements displacements has been inferior to minFeatureDisplacement | 21 /// indicates whether the sum of the last nDisplacements displacements has been inferior to minFeatureDisplacement |
| 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) | |
| 25 bool motionSmooth(const int& accelerationBound, const int& deviationBound) const; | |
| 26 | |
| 24 void addPoint(const int& frameNum, const cv::Point2f& p); | 27 void addPoint(const int& frameNum, const cv::Point2f& p); |
| 25 | 28 |
| 26 void shorten(void); | 29 void shorten(void); |
| 27 | 30 |
| 28 void write(TrajectoryDBAccess<cv::Point2f>& trajectoryDB) const; | 31 void write(TrajectoryDBAccess<cv::Point2f>& trajectoryDB) const; |
| 31 void draw(cv::Mat& img, const cv::Scalar& color) const; | 34 void draw(cv::Mat& img, const cv::Scalar& color) const; |
| 32 #endif | 35 #endif |
| 33 | 36 |
| 34 protected: | 37 protected: |
| 35 Trajectory<cv::Point2f> positions; | 38 Trajectory<cv::Point2f> positions; |
| 39 /** one fewer velocity than position | |
| 40 v_n = p_n+1 - p_n*/ | |
| 36 Trajectory<cv::Point2f> velocities; | 41 Trajectory<cv::Point2f> velocities; |
| 37 | 42 |
| 43 /// norms of velocities for feature constraints, one fewer positions than positions | |
| 38 std::vector<float> displacementDistances; | 44 std::vector<float> displacementDistances; |
| 39 | 45 |
| 40 void computeMotionData(const int& frameNum); | 46 void computeMotionData(const int& frameNum); |
| 41 | 47 |
| 42 }; | 48 }; |
