-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.hpp
365 lines (316 loc) · 10.6 KB
/
config.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
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
/*M///////////////////////////////////////////////////////////////////////////////////////
///
// config.hpp
//
//
// Created by Isabel Martins on 13/01/13.
// Copyright (c) 2013 Isabel Martins. All rights reserved.
//
/////////////////////////////////////////////////////////////////////////////////
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * The name of the copyright holders may not be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE. //
//M*/
#ifndef __Retina__config__
#define __Retina__config__
//#include <iostream>
#ifndef FILENAME_MAX_LEN
#define FILENAME_MAX_LEN 350
#endif
class Config {
/* general */
char inputSeqFile[FILENAME_MAX_LEN];
char inputMediaType[10];
int firstFrame;
int lastFrame;
int frameSkip;
char outputFiles[FILENAME_MAX_LEN];
char outputMediaType[10];
char saveOutput[3];
char displayOutput[3];
/* Retina and Retina Segm */
char retinaCfgFile[FILENAME_MAX_LEN];
char retinaLowResolution[3];
int MagnoChangedThreshold;
int MagnoMinObjectSize;
/* Colinearity config */
char COLIN_use_LPF[3];
int COLIN_pattern;
/* AngleMOG config */
int AngleMOG_NMixtures;
double AngleMOG_VarThreshold_L;
double AngleMOG_VarThreshold_A;
double AngleMOG_VarThreshold_B;
double AngleMOG_VarThreshold_Delta;
double AngleMOG_BackgroundRatio;
double AngleMOG_VarThresholdGen;
double AngleMOG_VarInit;
int AngleMOG_History;
double AngleMOG_ComplexityReductionThreshold;
double AngleMOG_BG_LearningRate;
double AngleMOG_UBG_LearningRate;
double AngleMOG_FG_LearningRate;
double AngleMOG_StepUBG_LearningRate;
double Dark_Threshold;
double Stopped_Threshold;
int AngleMOG_PostProcMedianFilterSize;
int AngleMOG_PostProcMinObjSize;
int AngleMOGTransientFrames;
int Final_PostProcMedianFilterSize;
int AngleMOGTemporalAnalysis;
int AngleMOGSpatialAnalysis;
public:
char *GetConfigInputSeq() {
return inputSeqFile;
}
char *GetConfigInputMediaType() {
return inputMediaType;
}
int GetConfigFirstFrame() {
return firstFrame;
}
int GetConfigLastFrame() {
return lastFrame;
}
int GetConfigFrameSkip() {
return frameSkip;
}
char *GetConfigOutputFiles() {
return outputFiles;
}
char *GetConfigOutputMediaType() {
return outputMediaType;
}
char *GetConfigSaveOuput() {
return saveOutput;
}
char *GetConfigDisplayOuput() {
return displayOutput;
}
char *GetConfigRetinaFile() {
return retinaCfgFile;
}
char *GetRetinaLowResolution() {
return retinaLowResolution;
}
int GetMagnoChangedThreshold() {
return MagnoChangedThreshold;
}
int GetMagnoMinObjectSize() {
return MagnoMinObjectSize;
}
int GetColinPattern() {
return COLIN_pattern;
}
char *GetColinUseLPF() {
return COLIN_use_LPF;
}
int GetAngleMOGNMixtures() {
return AngleMOG_NMixtures;
}
double GetAngleMOGVarThreshold_L() {
return AngleMOG_VarThreshold_L;
}
double GetAngleMOGVarThreshold_A() {
return AngleMOG_VarThreshold_A;
}
double GetAngleMOGVarThreshold_B() {
return AngleMOG_VarThreshold_B;
}
double GetAngleMOGVarThreshold_Delta() {
return AngleMOG_VarThreshold_Delta;
}
double GetAngleMOGBackgroundRatio() {
return AngleMOG_BackgroundRatio;
}
double GetAngleMOGVarThresholdGen() {
return AngleMOG_VarThresholdGen;
}
double GetAngleMOGVarInit() {
return AngleMOG_VarInit;
}
int GetAngleMOGHistory() {
return AngleMOG_History;
}
double GetAngleMOGComplexityReductionThreshold() {
return AngleMOG_ComplexityReductionThreshold;
}
double GetAngleMOG_BG_LearningRate() {
return AngleMOG_BG_LearningRate;
}
double GetAngleMOG_UBG_LearningRate() {
return AngleMOG_UBG_LearningRate;
}
double GetAngleMOG_FG_LearningRate() {
return AngleMOG_FG_LearningRate;
}
double GetAngleMOG_StepUBG_LearningRate() {
return AngleMOG_StepUBG_LearningRate;
}
double Get_Dark_Threshold() {
return Dark_Threshold;
}
double Get_Stopped_Threshold() {
return Stopped_Threshold;
}
int GetAngleMOGPostProcMedianFilterSize() {
return AngleMOG_PostProcMedianFilterSize;
}
int GetAngleMOGPostProcMinObjectSize() {
return AngleMOG_PostProcMinObjSize;
}
int GetFinalPostProcMedianFilterSize() {
return Final_PostProcMedianFilterSize;
}
int GetAngleMOGTransientFrames() {
return AngleMOGTransientFrames;
}
int GetAngleMOGTemporalAnalysis() {
return AngleMOGTemporalAnalysis;
}
int GetAngleMOGSpatialAnalysis() {
return AngleMOGSpatialAnalysis;
}
void PutConfigInputSeq(char *in_seq) {
strcpy(inputSeqFile, in_seq);
}
void PutConfigInputMediaType(char *in_media_type) {
strcpy(inputMediaType, in_media_type);
}
void PutConfigFirstFrame(int start_frame) {
firstFrame = start_frame;
}
void PutConfigLastFrame(int max_frame) {
lastFrame = max_frame;
}
void PutConfigFrameSkip(int frame_skip) {
frameSkip = frame_skip;
}
void PutConfigOutputFiles(char *out_seq) {
strcpy(outputFiles, out_seq);
}
void PutConfigOutputMediaType(char *out_media_type) {
strcpy(outputMediaType, out_media_type);
}
void PutConfigSaveOutput(char *save_output) {
strcpy(saveOutput, save_output);
}
void PutConfigDisplayOutput(char *display_output) {
strcpy(displayOutput, display_output);
}
void PutConfigRetinaFile(char *retina_file) {
strcpy(retinaCfgFile, retina_file);
}
void PutRetinaLowResolution(char *retina_low_res) {
strcpy(retinaLowResolution, retina_low_res);
}
void PutMagnoChangedThreshold(int thresh) {
MagnoChangedThreshold = thresh;
}
void PutMagnoMinObjectSize(int minSize) {
MagnoMinObjectSize = minSize;
}
void PutColinPattern(int patt) {
COLIN_pattern = patt;
}
void PutColinUseLPF(char *use_lpf) {
strcpy(COLIN_use_LPF, use_lpf);
}
void PutAngleMOGNMixtures(int NMix) {
AngleMOG_NMixtures = NMix;
}
void PutAngleMOGVarThreshold_L(double varThresh) {
AngleMOG_VarThreshold_L = varThresh;
}
void PutAngleMOGVarThreshold_A(double varThresh) {
AngleMOG_VarThreshold_A = varThresh;
}
void PutAngleMOGVarThreshold_B(double varThresh) {
AngleMOG_VarThreshold_B = varThresh;
}
void PutAngleMOGVarThreshold_Delta(double varThreshDelta) {
AngleMOG_VarThreshold_Delta = varThreshDelta;
}
void PutAngleMOGBackgroundRatio(double bkgRatio) {
AngleMOG_BackgroundRatio = bkgRatio;
}
void PutAngleMOGVarThresholdGen(double varThresgGen) {
AngleMOG_VarThresholdGen = varThresgGen;
}
void PutAngleMOGVarInit(double varInit) {
AngleMOG_VarInit = varInit;
}
void PutAngleMOGHistory(int nHist) {
AngleMOG_History = nHist;
}
void PutAngleMOGComplexityReductionThreshold(double redThresh) {
AngleMOG_ComplexityReductionThreshold = redThresh;
}
void PutAngleMOG_BG_LearningRate(double learnRate) {
AngleMOG_BG_LearningRate = learnRate;
}
void PutAngleMOG_UBG_LearningRate(double learnRate) {
AngleMOG_UBG_LearningRate = learnRate;
}
void PutAngleMOG_FG_LearningRate(double learnRate) {
AngleMOG_FG_LearningRate = learnRate;
}
void PutAngleMOG_StepUBG_LearningRate(double learnRate) {
AngleMOG_StepUBG_LearningRate = learnRate;
}
void Put_Dark_Threshold(double thresh) {
Dark_Threshold = thresh;
}
void Put_Stopped_Threshold(double thresh) {
Stopped_Threshold = thresh;
}
void PutAngleMOGPostProcMedianFilterSize(int postProcFilter) {
AngleMOG_PostProcMedianFilterSize = postProcFilter;
}
void PutAngleMOGPostProcMinObjectSize(int postProcMinObj) {
AngleMOG_PostProcMinObjSize = postProcMinObj;
}
void PutFinalPostProcMedianFilterSize(int postProcFilter) {
Final_PostProcMedianFilterSize = postProcFilter;
}
void PutAngleMOGTransientFrames(int nframes) {
AngleMOGTransientFrames = nframes;
}
void PutAngleMOGTemporalAnalysis(int value) {
AngleMOGTemporalAnalysis = value;
}
void PutAngleMOGSpatialAnalysis(int value) {
AngleMOGSpatialAnalysis = value;
}
};
void ReadConfigFile(char * config_file, Config *cfg);
void PrintConfig(Config *cfg);
#endif /* defined(__Retina__config__) */