-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdwisard.hpp
More file actions
59 lines (51 loc) · 1.16 KB
/
Copy pathcdwisard.hpp
File metadata and controls
59 lines (51 loc) · 1.16 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
//
// cwisard.hpp
//
//
// Created by Maurizio Giordano on 25/05/15.
//
//
#ifndef _cwisard_hpp
#define _cwisard_hpp
#include <stdio.h>
#include <iostream>
#include <sys/time.h>
#include <iostream>
#include <getopt.h>
#include <dirent.h>
// TCLAP include
#include "tclap/CmdLine.h"
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/video/background_segm.hpp>
#include <bgwis.hpp>
using namespace cv;
using namespace std;
using namespace TCLAP;
int MAXWIDTH = 30;
char filler = ' ';
// String Tokenizer
vector<string> tokenizer(string str, char delimiter) {
vector<string> v;
istringstream buf(str);
for(string token; getline(buf, token, delimiter); ) {
v.push_back(token);
}
return v;
}
int parsePolicy(string settings,int &incr, int &decr) {
vector<string> args = tokenizer(settings, ':') ;
if (args.size() != 2) {
return -1;
} else {
incr = atoi(args[0].c_str());
decr = atoi(args[1].c_str());
if (incr < 1 || decr < 0) {
return -1;
}
return 0;
}
}
#endif