Image Component Library (ICL)
|
Implementation of the Hungarian Algorithm to solve Linear Assignment problems. More...
#include <HungarianAlgorithm.h>
Static Public Member Functions | |
static std::vector< int > | apply (const utils::Array2D< real > &m, bool isCostMatrix=true) |
calculate best assignment given cost matrix m | |
static void | visualizeAssignment (const utils::Array2D< real > &cost, const std::vector< int > &assignment) |
visualized the assignment with given cost matrix and assignment vector | |
Private Types | |
typedef utils::Array2D< real > | mat |
Internal used cost matrix type. |
Implementation of the Hungarian Algorithm to solve Linear Assignment problems.
A LAP is defined as follows: You have workers and tasks . Assigning a certain worker to a certain task produces costs which are defined by a square cost matrix . Each worker can only be assigned to perform a single task, and each task has to be processed. The problem is to find the optimal assignment to minimize the arising costs.
typedef utils::Array2D<real> icl::cv::HungarianAlgorithm< real >::mat [private] |
Internal used cost matrix type.
static std::vector<int> icl::cv::HungarianAlgorithm< real >::apply | ( | const utils::Array2D< real > & | m, |
bool | isCostMatrix = true |
||
) | [static] |
calculate best assignment given cost matrix m
if isCostMatrix is false, its elements are internally multiplied by -1
static void icl::cv::HungarianAlgorithm< real >::visualizeAssignment | ( | const utils::Array2D< real > & | cost, |
const std::vector< int > & | assignment | ||
) | [static] |
visualized the assignment with given cost matrix and assignment vector