-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathTrackerParameter.h
More file actions
182 lines (150 loc) · 4.5 KB
/
Copy pathTrackerParameter.h
File metadata and controls
182 lines (150 loc) · 4.5 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#ifndef TRACKERPARAMETER_H
#define TRACKERPARAMETER_H
#include "Interfaces/IModel/IModel.h"
#include "settings/Settings.h"
#include "Model/TrackingAlgorithm/property/ParamNames.h"
class TrackerParameter : public IModel
{
Q_OBJECT
public:
TrackerParameter(QObject *parent = 0);
void setThreshold(int x);
int getThreshold();
BioTracker::Core::Settings *getSettings() { return _settings; };
void setBinarizationThreshold(int x);
int getBinarizationThreshold();
int getSizeErode() { return m_SizeErode; };
void setSizeErode(int x) {
m_SizeErode = x;
Q_EMIT notifyView();
};
int getSizeDilate() { return m_SizeDilate; };
void setSizeDilate(int x) {
m_SizeDilate = x;
Q_EMIT notifyView();
};
int getmog2History() { return m_mog2History; };
void setmog2History(int x) {
m_mog2History = x;
Q_EMIT notifyView();
};
int getmog2VarThresh() { return m_mog2VarThresh; };
void setmog2VarThresh(int x) {
m_mog2VarThresh = x;
Q_EMIT notifyView();
};
double getmog2BackgroundRatio() { return m_mog2BackgroundRatio; };
void setmog2BackgroundRatio(double x) {
m_mog2BackgroundRatio = x;
Q_EMIT notifyView();
};
double getMinBlobSize() { return m_MinBlobSize; };
void setMinBlobSize(double x) {
m_MinBlobSize = x;
Q_EMIT notifyView();
};
double getMaxBlobSize() { return m_MaxBlobSize; };
void setMaxBlobSize(double x) {
m_MaxBlobSize = x;
Q_EMIT notifyView();
};
bool getDoBackground() { return m_doBackground; };
void setDoBackground(bool x) {
m_doBackground = x;
Q_EMIT notifyView();
};
bool getDoNetwork() { return m_doNetwork; };
void setDoNetwork(bool x) {
m_doNetwork = x;
Q_EMIT notifyView();
};
int getSendImage() { return m_sendImage; };
void setSendImage(int x) {
m_sendImage = x;
Q_EMIT notifyView();
};
bool getResetBackground() { return m_resetBackground; };
void setResetBackground(bool x) {
m_resetBackground = x;
Q_EMIT notifyView();
};
int getNoFish() { return m_noFish; };
void setNoFish(int x) {
m_noFish = x;
_settings->setParam(FISHTANKPARAM::FISHTANK_FISH_AMOUNT, x);
Q_EMIT notifyView();
};
int getAreaWidth() { return m_areaWidth; };
void setAreaWidth(int x) {
m_areaWidth = x;
_settings->setParam(FISHTANKPARAM::FISHTANK_AREA_WIDTH, x);
Q_EMIT notifyView();
};
int getAreaHeight() { return m_areaHeight; };
void setAreaHeight(int x) {
m_areaHeight = x;
_settings->setParam(FISHTANKPARAM::FISHTANK_AREA_HEIGHT, x);
Q_EMIT notifyView();
};
std::string getNewSelection() { return m_newSelection; };
void setNewSelection(std::string x) {
m_newSelection = x;
}
void setAll(
int Threshold,
int BinarizationThreshold,
int SizeErode,
int SizeDilate,
int mog2History,
int mog2VarThresh,
double mog2BackgroundRatio,
int minBlobSize,
int maxBlobSize,
int areaWidth,
int areaHeight)
{
m_Threshold = Threshold;
m_BinarizationThreshold = BinarizationThreshold;
m_SizeErode = SizeErode;
m_SizeDilate = SizeDilate;
m_mog2History = mog2History;
m_mog2VarThresh = mog2VarThresh;
m_mog2BackgroundRatio = mog2BackgroundRatio;
m_MinBlobSize = minBlobSize;
m_MaxBlobSize = maxBlobSize;
m_areaWidth = areaWidth;
m_areaHeight = areaHeight;
_settings->setParam(TRACKERPARAM::THRESHOLD_BINARIZING, BinarizationThreshold);
_settings->setParam(TRACKERPARAM::SIZE_ERODE, SizeErode);
_settings->setParam(TRACKERPARAM::SIZE_DILATE, SizeDilate);
_settings->setParam(TRACKERPARAM::MIN_BLOB_SIZE, minBlobSize);
_settings->setParam(TRACKERPARAM::MAX_BLOB_SIZE, maxBlobSize);
_settings->setParam(TRACKERPARAM::BG_MOG2_HISTORY, mog2History);
_settings->setParam(TRACKERPARAM::BG_MOG2_VAR_THRESHOLD, mog2VarThresh);
_settings->setParam(TRACKERPARAM::BG_MOG2_BACKGROUND_RATIO, mog2BackgroundRatio);
_settings->setParam(FISHTANKPARAM::FISHTANK_AREA_WIDTH, areaWidth);
_settings->setParam(FISHTANKPARAM::FISHTANK_AREA_HEIGHT, areaHeight);
Q_EMIT notifyView();
};
private:
BioTracker::Core::Settings *_settings;
int m_Threshold;
int m_BinarizationThreshold;
int m_SizeErode;
int m_SizeDilate;
int m_mog2History;
int m_mog2VarThresh;
double m_mog2BackgroundRatio;
int m_MinBlobSize;
int m_MaxBlobSize;
bool m_doBackground;
int m_sendImage;
bool m_resetBackground;
int m_noFish;
int m_areaWidth;
int m_areaHeight;
int m_networkPort;
bool m_doNetwork;
std::string m_newSelection;
};
#endif // TRACKERPARAMETER_H