-
Notifications
You must be signed in to change notification settings - Fork 184
/
Fusion.cpp
36 lines (27 loc) · 964 Bytes
/
Fusion.cpp
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
31
32
33
34
35
36
#include "Fusion.h"
namespace cmt {
void Fusion::preferFirst(const vector<Point2f> & points_first, const vector<int> & classes_first,
const vector<Point2f> & points_second, const vector<int> & classes_second,
vector<Point2f> & points_fused, vector<int> & classes_fused)
{
FILE_LOG(logDEBUG) << "Fusion::preferFirst() call";
points_fused = points_first;
classes_fused = classes_first;
for (size_t i = 0; i < points_second.size(); i++)
{
int class_second = classes_second[i];
bool found = false;
for (size_t j = 0; j < points_first.size(); j++)
{
int class_first = classes_first[j];
if (class_first == class_second) found = true;
}
if (!found)
{
points_fused.push_back(points_second[i]);
classes_fused.push_back(class_second);
}
}
FILE_LOG(logDEBUG) << "Fusion::preferFirst() return";
}
} /* namespace cmt */