+ return 0.1;
+}
+
+void MultiTracker::update(unsigned int total, const Detection* detections, const Mat& image)
+{
+ // correct_trackers
+ // Generate cost matrix
+ int row = trackers.size();
+ int col = total;
+ MatrixXi cost_matrix = MatrixXi::Zero(row, col);
+ for (int i = 0; i < row; i++){
+ for (int j = 0; j < col; j++){
+ // TODO
+ // int cost = MaxCost;
+ cost_matrix(i, j) = distance(trackers[i], image, detections[j]);
+ }
+ }
+
+ // assignment
+ VectorXi tracker_inds, bb_inds;
+ linear_sum_assignment(cost_matrix, tracker_inds, bb_inds);
+
+ // handle unmatched trackers
+ vector<TrackerPtr> unmatched_trackers;
+ for (int i = 0; i < row; i++){
+ if (!(tracker_inds.array() == i).any()){
+ unmatched_trackers.push_back(trackers[i]);
+ }
+ }
+ for (auto t : unmatched_trackers){
+ t->updateState(image);
+ }
+