changeset 189:1116f0a1ff31

work on connected components (does not compile)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 02 Dec 2011 19:11:53 -0500
parents 1435965d8181
children 36968a63efe1
files c/Motion.cpp c/feature-based-tracking.cpp
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/c/Motion.cpp	Thu Dec 01 19:18:32 2011 -0500
+++ b/c/Motion.cpp	Fri Dec 02 19:11:53 2011 -0500
@@ -159,22 +159,22 @@
 	UndirectedGraph::edge_descriptor e;
 	bool unused;
 	tie(e, unused) = add_edge(newVertex, *vi, graph);
-	// no need to add measures to graph[e]
+	// no need to add measures to graph[e] (edge properties)
       }
     }
   }
 }
 
 void FeatureGraph::connectedComponents(const int& lastInstant) {
-  vector<int> component(num_vertices(graph));
-  // int num = connected_components(graph, &component[0]);
-  // todo change the type of the component map http://www.boost.org/doc/libs/1_48_0/libs/graph/doc/connected_components.html
-
+  typedef boost::graph_traits<UndirectedGraph>::vertices_size_type vertices_size_type;
+  vector<vertices_size_type> components(num_vertices(graph));
+  // int num = connected_components(graph, &components[0]);
+  // // todo change the type of the component map http://www.boost.org/doc/libs/1_48_0/libs/graph/doc/connected_components.html
   // cout << "Total number of components: " << num << endl;
 
-  for (unsigned int i = 0; i < component.size(); ++i)
-      cout << "Vertex " << i <<" is in component " << component[i] << endl;
-  cout << endl;
+  // for (unsigned int i = 0; i < components.size(); ++i)
+  //     cout << "Vertex " << i <<" is in component " << components[i] << endl;
+  // cout << endl;
 }
 
 string FeatureGraph::informationString(void) {
--- a/c/feature-based-tracking.cpp	Thu Dec 01 19:18:32 2011 -0500
+++ b/c/feature-based-tracking.cpp	Fri Dec 02 19:11:53 2011 -0500
@@ -287,7 +287,7 @@
 
     // check for connected components that are old enough (no chance to match with trajectories to be added later
     if (frameNum%10 == 0) {
-      
+      featureGraph.connectedComponents(frameNum-maxTrajectoryLength+params.minFeatureTime);
     }
 
     cout << featureGraph.informationString() << endl;