munkre.h
Go to the documentation of this file.
1 #ifndef MUNKRE_H
2 #define MUNKRE_H
3 
4 #include <opencv2/core/core.hpp>
5 
6 
7 
8 namespace tuw {
16 class Munkre {
17 public:
25  static std::vector<std::pair<size_t, size_t>> find_minimum_assignment ( const cv::Mat_<double> costmatrix );
26 
27 private:
31  enum Zero {
32  UNDEF = 0,
33  STAR = 1,
34  PRIME = 2,
35  };
36 
42  static void step_0 (const cv::Mat_<double> costmatrix, cv::Mat_<double> &C, bool &transpose, size_t &k, size_t &step);
43 
48  static void step_1 (cv::Mat_<double> &C, size_t &step);
49 
54  static void step_2 (const cv::Mat_<double> C, cv::Mat_<Zero> &M, std::vector<bool> &row_cover, std::vector<bool> &col_cover, size_t &step);
55 
61  static void step_3 (const cv::Mat_<Zero> M, std::vector<bool> &col_cover, const size_t k, size_t &step);
62 
69  static void step_4 (const cv::Mat_<double> C, cv::Mat_<Zero> &M, std::vector<bool> &row_cover, std::vector<bool> &col_cover, std::vector<std::pair<size_t, size_t>> &path, size_t &step);
70 
81  static void step_5 (cv::Mat_<Zero> M, std::vector<bool> &row_cover, std::vector<bool> &col_cover, std::vector<std::pair<size_t, size_t>> &path, size_t &step);
82 
88  static void step_6 (cv::Mat_<double> C, const std::vector<bool> row_cover, const std::vector<bool> col_cover, size_t &step);
89 
97  static void step_7 (const cv::Mat_<Zero> M, const bool transpose, std::vector<std::pair<size_t, size_t>> &result, size_t &k, size_t &step);
98 
102  static void find_uncovered_zero (const cv::Mat_<double> C, const std::vector<bool> row_cover, const std::vector<bool> col_cover, int &row, int &col);
103 
107  static int find_zero_in_row (const cv::Mat_<Zero> M, const size_t row, const Zero type);
108 
112  static int find_zero_in_col (const cv::Mat_<Zero> M, const size_t col, const Zero type);
113 
117  static void print (const cv::Mat_<double> C, const cv::Mat_<Zero> M, const std::vector<bool> row_cover, const std::vector<bool> col_cover, const size_t step);
118 };
119 };
120 
121 #endif // MUNKRE_H
static void find_uncovered_zero(const cv::Mat_< double > C, const std::vector< bool > row_cover, const std::vector< bool > col_cover, int &row, int &col)
Definition: munkre.cpp:306
static int find_zero_in_col(const cv::Mat_< Zero > M, const size_t col, const Zero type)
Definition: munkre.cpp:331
static void step_0(const cv::Mat_< double > costmatrix, cv::Mat_< double > &C, bool &transpose, size_t &k, size_t &step)
Definition: munkre.cpp:59
static void step_2(const cv::Mat_< double > C, cv::Mat_< Zero > &M, std::vector< bool > &row_cover, std::vector< bool > &col_cover, size_t &step)
Definition: munkre.cpp:99
static void step_6(cv::Mat_< double > C, const std::vector< bool > row_cover, const std::vector< bool > col_cover, size_t &step)
Definition: munkre.cpp:249
static void step_5(cv::Mat_< Zero > M, std::vector< bool > &row_cover, std::vector< bool > &col_cover, std::vector< std::pair< size_t, size_t >> &path, size_t &step)
Definition: munkre.cpp:194
Definition: ekf_slam.h:8
static int find_zero_in_row(const cv::Mat_< Zero > M, const size_t row, const Zero type)
Definition: munkre.cpp:322
static void print(const cv::Mat_< double > C, const cv::Mat_< Zero > M, const std::vector< bool > row_cover, const std::vector< bool > col_cover, const size_t step)
Definition: munkre.cpp:340
static void step_4(const cv::Mat_< double > C, cv::Mat_< Zero > &M, std::vector< bool > &row_cover, std::vector< bool > &col_cover, std::vector< std::pair< size_t, size_t >> &path, size_t &step)
Definition: munkre.cpp:162
static std::vector< std::pair< size_t, size_t > > find_minimum_assignment(const cv::Mat_< double > costmatrix)
Definition: munkre.cpp:5
static void step_7(const cv::Mat_< Zero > M, const bool transpose, std::vector< std::pair< size_t, size_t >> &result, size_t &k, size_t &step)
Definition: munkre.cpp:278
static void step_1(cv::Mat_< double > &C, size_t &step)
Definition: munkre.cpp:77
static void step_3(const cv::Mat_< Zero > M, std::vector< bool > &col_cover, const size_t k, size_t &step)
Definition: munkre.cpp:141


tuw_marker_slam
Author(s): Markus Macsek
autogenerated on Mon Jun 10 2019 15:39:09