comparison include/Motion.hpp @ 362:cc8e54997d4c

corrected error in tests and changed sstream to ostream for FeatureTrajectory operator<<
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 12 Jul 2013 00:22:09 -0400
parents 249d65ff6c35
children 03dbecd3a887
comparison
equal deleted inserted replaced
361:9d486af42e49 362:cc8e54997d4c
51 51
52 #ifdef USE_OPENCV 52 #ifdef USE_OPENCV
53 void draw(cv::Mat& img, const cv::Mat& homography, const cv::Scalar& color) const; 53 void draw(cv::Mat& img, const cv::Mat& homography, const cv::Scalar& color) const;
54 #endif 54 #endif
55 55
56 friend std::stringstream& operator<<(std::stringstream& out, const FeatureTrajectory& ft); 56 friend std::ostream& operator<<(std::ostream& out, const FeatureTrajectory& ft);
57 57
58 protected: 58 protected:
59 /// first frame number 59 /// first frame number
60 unsigned int firstInstant; 60 unsigned int firstInstant;
61 /// last frame number 61 /// last frame number
62 unsigned int lastInstant; 62 unsigned int lastInstant;
63 63
64 TrajectoryPoint2fPtr positions; 64 TrajectoryPoint2fPtr positions;
65 /** one fewer velocity than position 65 /** one fewer velocity than position
66 v_n = p_n+1 - p_n*/ 66 v_n = p_n - p_n-1*/
67 TrajectoryPoint2fPtr velocities; 67 TrajectoryPoint2fPtr velocities;
68 68
69 /// norms of velocities for feature constraints, one fewer positions than positions 69 /// norms of velocities for feature constraints, one fewer positions than positions
70 std::vector<float> displacementDistances; 70 std::vector<float> displacementDistances;
71 71
73 }; 73 };
74 74
75 typedef boost::shared_ptr<FeatureTrajectory> FeatureTrajectoryPtr; 75 typedef boost::shared_ptr<FeatureTrajectory> FeatureTrajectoryPtr;
76 76
77 // inlined 77 // inlined
78 inline std::stringstream& operator<<(std::stringstream& out, const FeatureTrajectory& ft) { 78 inline std::ostream& operator<<(std::ostream& out, const FeatureTrajectory& ft) {
79 out << *(ft.positions); 79 out << *(ft.positions);
80 out << "\n"; 80 out << "\n";
81 out << *(ft.velocities); 81 out << *(ft.velocities);
82 return out; 82 return out;
83 } 83 }