Kuhn Munkres#
-
class KuhnMunkres#
The KuhnMunkres class.
Solves the assignment problem.
Public Functions
-
explicit KuhnMunkres(bool greedy = false)#
Initializes the class for assignment problem solving.
- Parameters:
greedy – [in] If a faster greedy matching algorithm should be used.
-
std::vector<size_t> Solve(const cv::Mat &dissimilarity_matrix)#
Solves the assignment problem for given dissimilarity matrix. It returns a vector that where each element is a column index for corresponding row (e.g. result[0] stores optimal column index for very first row in the dissimilarity matrix).
- Parameters:
dissimilarity_matrix – CV_32F dissimilarity matrix.
- Returns:
Optimal column index for each row. -1 means that there is no column for row.
Private Functions
-
void TrySimpleCase()#
-
bool CheckIfOptimumIsFound()#
-
cv::Point FindUncoveredMinValPos()#
-
void UpdateDissimilarityMatrix(float val)#
-
int FindInRow(int row, int what)#
-
int FindInCol(int col, int what)#
-
void Run()#
-
explicit KuhnMunkres(bool greedy = false)#