-
Notifications
You must be signed in to change notification settings - Fork 10
/
SkeletonEdgeMatchScores.h
51 lines (31 loc) · 1.14 KB
/
SkeletonEdgeMatchScores.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef IMAGEPROCESSING_SKELETON_EDGE_MATCH_SCORES_H__
#define IMAGEPROCESSING_SKELETON_EDGE_MATCH_SCORES_H__
class SkeletonEdgeMatchScores {
public:
SkeletonEdgeMatchScores(std::string name) : _name(name) {}
void setSource(std::shared_ptr<Skeleton> source) { _source = source; }
void setTarget(std::shared_ptr<Skeleton> target) { _target = target; }
std::shared_ptr<Skeleton> getSource() const { return _source; }
std::shared_ptr<Skeleton> getTarget() const { return _target; }
void setScore(unsigned int e, unsigned int f, double score) {
_scores[std::make_pair(e, f)] = score;
}
double getScore(unsigned int e, unsigned int f) const {
if (!_scores.count(std::make_pair(e, f)))
return 0;
return _scores.at(std::make_pair(e,f));
}
double getMaxScore() const {
double max = 0;
for (auto p : _scores)
max = std::max(max, p.second);
return max;
}
std::string getName() const { return _name; }
private:
std::shared_ptr<Skeleton> _source;
std::shared_ptr<Skeleton> _target;
std::map<std::pair<unsigned int, unsigned int>, double> _scores;
std::string _name;
};
#endif // IMAGEPROCESSING_SKELETON_EDGE_MATCH_SCORES_H__