diff 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
line wrap: on
line diff
--- a/include/Motion.hpp	Fri Aug 19 12:15:23 2011 -0400
+++ b/include/Motion.hpp	Tue Aug 23 13:14:47 2011 -0400
@@ -21,6 +21,9 @@
   /// indicates whether the sum of the last nDisplacements displacements has been inferior to minFeatureDisplacement
   bool smallDisplacement(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;
+
   void addPoint(const int& frameNum, const cv::Point2f& p);
 
   void shorten(void);
@@ -33,8 +36,11 @@
 
 protected:
   Trajectory<cv::Point2f> positions;
+  /** one fewer velocity than position
+      v_n = p_n+1 - p_n*/
   Trajectory<cv::Point2f> velocities;
   
+  /// norms of velocities for feature constraints, one fewer positions than positions
   std::vector<float> displacementDistances;
 
   void computeMotionData(const int& frameNum);