+ for (unsigned int j = 0; j < total; j++){
+ if (!(bb_inds.array() == j).any()){
+ unmatch_bbs_indices.insert(j);
+ }
+ }
+
+ // handle matched trackers
+ for (unsigned int i = 0; i < tracker_inds.size(); i++){
+ for (int j = 0; j < bb_inds.size(); j++){
+ int rr = tracker_inds(i);
+ int cc = bb_inds(j);
+ TrackerPtr tracker = trackers[rr];
+ const Detection& detect = detections[cc];
+ if (cost_matrix(rr, cc) < MaxCost){
+ tracker->correct(image, detect);
+ tracker->addPatch(createPatch(image, detect));
+ } else {
+ unmatched_trackers.insert(tracker); // failed trackers
+ unmatch_bbs_indices.insert(cc); // filed detection
+ }
+ }
+ }
+
+ // handle unmatched trackers