forked from MACNICA-CLAVIS-NV/deepstream_pose_estimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
munkres_algorithm.hpp
30 lines (22 loc) · 1.17 KB
/
munkres_algorithm.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
template <class T>
using Vec1D = std::vector<T>;
template <class T>
using Vec2D = std::vector<Vec1D<T>>;
template <class T>
using Vec3D = std::vector<Vec2D<T>>;
// Helper method to subtract the minimum row from cost_graph
void subtract_minimum_row(Vec2D<float> &cost_graph, int nrows, int ncols);
// Helper method to subtract the minimum col from cost_graph
void subtract_minimum_column(Vec2D<float> &cost_graph, int nrows, int ncols);
void munkresStep1(Vec2D<float> &cost_graph, PairGraph &star_graph, int nrows, int ncols);
// Exits if '1' is returned
bool munkresStep2(const PairGraph &star_graph, CoverTable &cover_table);
bool munkresStep3(Vec2D<float> &cost_graph, const PairGraph &star_graph,
PairGraph &prime_graph, CoverTable &cover_table, std::pair<int, int> &p,
int nrows, int ncols);
void munkresStep4(PairGraph &star_graph, PairGraph &prime_graph,
CoverTable &cover_table, std::pair<int, int> &p);
void munkresStep5(Vec2D<float> &cost_graph, const CoverTable &cover_table,
int nrows, int ncols);
void munkres_algorithm(Vec2D<float> &cost_graph, PairGraph &star_graph, int nrows,
int ncols);