Mercurial Hosting > traffic-intelligence
diff include/Motion.hpp @ 176:9323427aa0a3
changed positions and velocities to shared pointers and renamed methods
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 27 Oct 2011 13:56:46 -0400 |
parents | 50964af05a80 |
children | ae2286b1a3fd |
line wrap: on
line diff
--- a/include/Motion.hpp Wed Oct 26 19:09:50 2011 -0400 +++ b/include/Motion.hpp Thu Oct 27 13:56:46 2011 -0400 @@ -8,6 +8,8 @@ template<typename T> class TrajectoryDBAccess; +typedef boost::shared_ptr<TrajectoryPoint2f> TrajectoryPoint2fPtr; + /** Class for feature data positions, velocities and other statistics to evaluate their quality before saving. */ @@ -15,18 +17,18 @@ public: FeatureTrajectory(const int& frameNum, const cv::Point2f& p, const cv::Mat& homography); - unsigned int length(void) const { return positions.size();} + unsigned int length(void) const { return positions->size();} - void setId(const unsigned int& id) { positions.setId(id);velocities.setId(id);} + void setId(const unsigned int& id) { positions->setId(id);velocities->setId(id);} void setLost(void) { lost = true;} bool isLost(void) { return lost;} /// indicates whether the sum of the last nDisplacements displacements has been inferior to minFeatureDisplacement - bool smallDisplacement(const unsigned int& nDisplacements, const float& minTotalFeatureDisplacement) const; + bool isDisplacementSmall(const unsigned int& nDisplacements, const float& minTotalFeatureDisplacement) const; /// indicates whether the last two displacements are smooth (limited acceleration and angle) - bool motionSmooth(const int& accelerationBound, const int& deviationBound) const; + bool isMotionSmooth(const int& accelerationBound, const int& deviationBound) const; void addPoint(const int& frameNum, const cv::Point2f& p, const cv::Mat& homography); @@ -40,10 +42,10 @@ protected: bool lost; - Trajectory<cv::Point2f> positions; + TrajectoryPoint2fPtr positions; /** one fewer velocity than position v_n = p_n+1 - p_n*/ - Trajectory<cv::Point2f> velocities; + TrajectoryPoint2fPtr velocities; /// norms of velocities for feature constraints, one fewer positions than positions std::vector<float> displacementDistances;