diff c/feature-based-tracking.cpp @ 191:0e60a306d324

added basic code to identify features and save them (crash)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 08 Dec 2011 18:32:35 -0500
parents 1116f0a1ff31
children a728fce85881
line wrap: on
line diff
--- a/c/feature-based-tracking.cpp	Wed Dec 07 18:51:32 2011 -0500
+++ b/c/feature-based-tracking.cpp	Thu Dec 08 18:32:35 2011 -0500
@@ -265,8 +265,9 @@
   int maxTrajectoryLength;
   trajectoryDB->maxTrajectoryLength(maxTrajectoryLength);
   cout << "max trajectory length " << maxTrajectoryLength << endl;
+  maxTrajectoryLength = 20; // for tests
 
-  FeatureGraph featureGraph(params.mmConnectionDistance, params.mmSegmentationDistance, params.minFeatureTime);
+  FeatureGraph featureGraph(params.mmConnectionDistance, params.mmSegmentationDistance, params.minFeatureTime, params.minNFeaturesPerGroup);
 
   // main loop
   // TODO version that can be interrupted?
@@ -286,8 +287,14 @@
     }
 
     // check for connected components that are old enough (no chance to match with trajectories to be added later
+    // we could check only when some features are getting old enough?
     if (frameNum%10 == 0) {
-      featureGraph.connectedComponents(frameNum-maxTrajectoryLength+params.minFeatureTime);
+      vector<vector<FeatureGraph::vertex_descriptor> > objects = featureGraph.connectedComponents(frameNum-maxTrajectoryLength+params.minFeatureTime);
+      cout << objects.size() << " objects" << endl;
+
+      if (!objects.empty()) {
+	vector<vector<unsigned int> > featureGroups = featureGraph.getFeatureGroups(objects);
+      }
     }
 
     cout << featureGraph.informationString() << endl;