Mercurial Hosting > traffic-intelligence
comparison include/Motion.hpp @ 192:38974d27dd2d
connected_components is working with listS for vertex list
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 12 Dec 2011 02:05:26 -0500 |
parents | 0e60a306d324 |
children | 09c7881073f3 |
comparison
equal
deleted
inserted
replaced
191:0e60a306d324 | 192:38974d27dd2d |
---|---|
43 | 43 |
44 /// indicates whether the last two displacements are smooth (limited acceleration and angle) | 44 /// indicates whether the last two displacements are smooth (limited acceleration and angle) |
45 bool isMotionSmooth(const int& accelerationBound, const int& deviationBound) const; | 45 bool isMotionSmooth(const int& accelerationBound, const int& deviationBound) const; |
46 | 46 |
47 /// computes the distance according to the Beymer et al. algorithm | 47 /// computes the distance according to the Beymer et al. algorithm |
48 bool minMaxSimilarity(const FeatureTrajectory& ft, const int& firstInstant, const int& lastInstant, float connectionDistance, float segmentationDistance); | 48 bool minMaxSimilarity(const FeatureTrajectory& ft, const int& firstInstant, const int& lastInstant, const float& connectionDistance, const float& segmentationDistance); |
49 | 49 |
50 void addPoint(const int& frameNum, const cv::Point2f& p, const cv::Mat& homography); | 50 void addPoint(const int& frameNum, const cv::Point2f& p, const cv::Mat& homography); |
51 | 51 |
52 void shorten(void); | 52 void shorten(void); |
53 | 53 |
99 float maxDistance; | 99 float maxDistance; |
100 }; | 100 }; |
101 | 101 |
102 struct VertexInformation { | 102 struct VertexInformation { |
103 FeatureTrajectoryPtr feature; | 103 FeatureTrajectoryPtr feature; |
104 int index; | |
104 }; | 105 }; |
105 | 106 |
106 typedef boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS, VertexInformation, FeatureConnection> UndirectedGraph; | 107 typedef boost::adjacency_list<boost::listS, boost::listS, boost::undirectedS, VertexInformation, FeatureConnection> UndirectedGraph; |
107 | 108 |
108 public: | 109 public: |
109 typedef UndirectedGraph::vertex_descriptor vertex_descriptor; | 110 typedef UndirectedGraph::vertex_descriptor vertex_descriptor; |
110 | 111 |
111 //FeatureGraph(float _minDistance, float _maxDistance) : minDistance (_minDistance), maxDistance(_maxDistance) {} | |
112 FeatureGraph(float _connectionDistance, float _segmentationDistance, unsigned int _minFeatureTime, float _minNFeaturesPerGroup) : connectionDistance (_connectionDistance), segmentationDistance(_segmentationDistance), minFeatureTime(_minFeatureTime), minNFeaturesPerGroup(_minNFeaturesPerGroup) {} | 112 FeatureGraph(float _connectionDistance, float _segmentationDistance, unsigned int _minFeatureTime, float _minNFeaturesPerGroup) : connectionDistance (_connectionDistance), segmentationDistance(_segmentationDistance), minFeatureTime(_minFeatureTime), minNFeaturesPerGroup(_minNFeaturesPerGroup) {} |
113 | 113 |
114 void addFeature(const FeatureTrajectoryPtr& ft); | 114 void addFeature(const FeatureTrajectoryPtr& ft); |
115 | 115 |
116 // add vertex, includes adding links to current vertices | 116 // add vertex, includes adding links to current vertices |
133 float minNFeaturesPerGroup; | 133 float minNFeaturesPerGroup; |
134 // float minDistance; | 134 // float minDistance; |
135 // float maxDistance; | 135 // float maxDistance; |
136 | 136 |
137 UndirectedGraph graph; | 137 UndirectedGraph graph; |
138 | |
139 void computeVertexIndex(void); | |
138 | 140 |
139 //std::vector<UndirectedGraph::vertex_descriptor> currentVertices, lostVertices; | 141 //std::vector<UndirectedGraph::vertex_descriptor> currentVertices, lostVertices; |
140 }; | 142 }; |
141 | 143 |
142 // inlined implementations | 144 // inlined implementations |