-
Notifications
You must be signed in to change notification settings - Fork 0
/
stage.cpp
70 lines (57 loc) · 1.41 KB
/
stage.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "stage.h"
Stage::Stage(QObject *parent) :
QObject(parent)
{
m_maxWeakCount = 0;
m_stageThreshold = 0;
}
Stage::Stage(const Stage &other)
{
m_maxWeakCount = other.maxWeakCount();
m_stageThreshold = other.stageThreshold();
for (int i = 0; i < other.maxWeakCount(); i++)
m_weakClassifiersList.append(other.getWeakClassifier(i));
}
Stage& Stage::operator =(const Stage &other)
{
if(this == &other)
return *this;
m_maxWeakCount = other.maxWeakCount();
m_stageThreshold = other.stageThreshold();
for (int i = 0; i < other.maxWeakCount(); i++)
m_weakClassifiersList.append(other.getWeakClassifier(i));
return *this;
}
int Stage::maxWeakCount() const
{
return m_maxWeakCount;
}
void Stage::setMaxWeakCount(const int maxWeakCount)
{
if (m_maxWeakCount != maxWeakCount)
{
m_maxWeakCount = maxWeakCount;
}
}
double Stage::stageThreshold() const
{
return m_stageThreshold;
}
void Stage::setStageThreshold(const double stageThreshold)
{
if (m_stageThreshold != stageThreshold)
{
m_stageThreshold = stageThreshold;
}
}
WeakClassifier Stage::getWeakClassifier(int index) const
{
if (index < m_weakClassifiersList.size())
return m_weakClassifiersList.at(index);
else
return WeakClassifier();
}
void Stage::appendWeakClassifier(const WeakClassifier &wc)
{
m_weakClassifiersList.append(wc);
}