Fix nan issue in features
[trackerpp.git] / include / hungarian.h
1 #ifndef _HUNGARIAN_H_
2 #define _HUNGARIAN_H_
3 #include <eigen3/Eigen/Dense>
4
5 // C++ version of linear_sum_assignment() in python scipy
6 // https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.optimize.linear_sum_assignment.html
7 // http://csclab.murraystate.edu/~bob.pilgrim/445/munkres.html
8 //
9
10 // @param cost_matrix The cost matrix
11 // @param row_ind, col_ind an array of row indices and one of corresponding column indices giving the optimal assignment.
12 // @return the cost of the assignment
13 int linear_sum_assignment(const Eigen::MatrixXi& cost_matrix, Eigen::VectorXi& row_ind, Eigen::VectorXi& col_ind);
14
15
16 #endif // _HUNGARIAN_H_