-
Notifications
You must be signed in to change notification settings - Fork 8
/
Settings.hpp
236 lines (172 loc) · 7.81 KB
/
Settings.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
#ifndef SETTINGS_HPP
#define SETTINGS_HPP
#include "opencv2/opencv.hpp"
using namespace std;
using namespace cv;
class Settings {
public:
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Input
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Video streams
////////////////////////////////////////////////////////////////////////////
// Logitech USB Camera
////////////////////////////////////////////////////////////////////////////////
// Camera index (sometimes the external USB camera is on 0 and sometimes on 1)
// The index of the camera have to be checked manually
// int video_capture_source = 0;
//
// // Saturation and value limits
// int saturation_min = 120;
// int value_min = 10;
// Calibration Data
Mat camera_intrinsic_matrix = (Mat_<double>(3, 3) <<
1.4006590516106746e+03, 0., 7.9950000000000000e+02,
0., 1.4006590516106746e+03, 5.9950000000000000e+02,
0., 0., 1.);
Mat camera_distortion_vector = (Mat_<double>(1, 5) <<
5.4296267484343998e-02, -5.9413030935709088e-01, 0., 0., 1.9565543630464968e+00);
// Inogeni
////////////////////////////////////////////////////////////////////////////////
// If USB device is Inogeni, uncomment this to set correct FPS
//#define INOGENI
// Screen mirroring application from DJI tablet
////////////////////////////////////////////////////////////////////////////////
//string video_capture_source = "rtsp://10.201.147.238:5000/screen";
//string video_capture_source = "http://195.67.26.73/mjpg/video.mjpg";
// HDMI stream from Teradek VidiU from Fotokite or 3DR Solo
////////////////////////////////////////////////////////////////////////////////
//string video_capture_source = "rtmp://127.0.0.1/EMILY_Tracker/fotokite";
////////////////////////////////////////////////////////////////////////////////
// Video files
////////////////////////////////////////////////////////////////////////////////
// Trial 1: Lake Bryan AI Robotic class field test 2016 03 28
////////////////////////////////////////////////////////////////////////////////
// Input video file
string video_capture_source = "input/2016_03_28_lake_bryan.mp4";
// Parameters for thresholding
// int saturation_min = 58;
// int value_min = 81;
// Parameters for histogramming
int saturation_min = 52;
int value_min = 10;
// Trial 2: Fort Bend floods 2016 04 23
////////////////////////////////////////////////////////////////////////////////
// Input video file
// string video_capture_source = "input/2016_04_23_fort_bend.mp4";
// Parameters for thresholding
// int saturation_min = 120;
// int value_min = 100;
// Parameters for histogramming
// int saturation_min = 120;
// int value_min = 100;
// Trial 3: Lake Bryan AI Robotics class final 2016 05 10
////////////////////////////////////////////////////////////////////////////////
// Input video file
// string video_capture_source = "input/2016_05_10_lake_bryan.mov";
// Parameters for thresholding
// int saturation_min = 30; // Was 10 in 2016
// int value_min = 10;
// Parameters for histogramming
// int saturation_min = 30; // Was 10 in 2016
// int value_min = 10;
// Trial 4: Lab 2016 07 05
////////////////////////////////////////////////////////////////////////////////
// Input video file
// string video_capture_source = "input/2016_07_05_lab.mp4";
// Parameters for thresholding
// int saturation_min = 167;
// int value_min = 50;
// int hue_2_min = 180; // Uncomment the other hue_2_min
// Parameters for histogramming
// int saturation_min = 130;
// int value_min = 10;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Algorithm Variable parameters
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Hue 1 range for thresholding
int hue_1_min = 0;
int hue_1_max = 10;
// Hue 2 range for thresholding
int hue_2_min = 160;
int hue_2_max = 180;
// Saturation range for thresholding
int saturation_max = 255;
// Value range for thresholding
int value_max = 255;
// Gaussian blur kernel size
int blur_kernel_size = 21;
// When the centroid of EMILY gets closer or equal to this number of pixels, it will consider target to be reached
int target_radius = 30;
// Value of the proportional parameter of PID
int proportional = 20;
// Camera angle in degrees
int camera_angle_degrees = 45;
double camera_angle_radians;
// Erode size
int erode_size = 2;
// Dilate size
int dilate_size = 16;
// EMILY location history size to estimate heading
const int EMILY_LOCATION_HISTORY_SIZE = 50;
////////////////////////////////////////////////////////////////////////////////
// Communication
////////////////////////////////////////////////////////////////////////////////
// IP address and port of EMILY control computer to which to send throttle and
// rudder valuers.
const char * IP_ADDRESS = "192.168.1.4";
const short PORT = 5007;
////////////////////////////////////////////////////////////////////////////////
// GUI Parameters
////////////////////////////////////////////////////////////////////////////////
// Enable four frame mode to get more detailed GUI.
//
// Two frame mode shows:
// 1. threshold
// 2. original image with tracking information
//
// Four frame mode shows:
// 1. blurred image
// 2. threshold
// 3. eroded dilated threshold
// 4. original image with tracking information
#define FOUR_FRAME_MODE
// Main window name
const string MAIN_WINDOW = "EMILY Tracker";
// Histogram window name
const string HISTOGRAM_WINDOW = "Histogram";
// Object position crosshairs color
const Scalar LOCATION_COLOR = Scalar(0, 255, 0);
// Object position crosshairs thickness
const int LOCATION_THICKNESS = 1;
// Object pose line color
const Scalar POSE_LINE_COLOR = Scalar(0, 255, 255);
// Thickness of pose estimation lines
const int POSE_LINE_THICKNESS = 1;
// Thickness of heading estimation lines
const int HEADING_LINE_THICKNESS = 1; // MOD change to 4 for lab testing
// Length of the heading line
const int HEADING_LINE_LENGTH = 20; // MOD change to 200 for lab testing
// Target color
const Scalar TARGET_COLOR = Scalar(0, 0, 255);
// Target crosshairs radius
const int TARGET_RADIUS = 10;
////////////////////////////////////////////////////////////////////////////////
// Algorithm Static Parameters
////////////////////////////////////////////////////////////////////////////////
// Input will be resized to this number of lines to speed up the processing
//const int PROCESSING_VIDEO_HEIGHT_LIMIT = 640; // MOD webcam resolution
// Higher resolution will be better if EMILY is in the distance
//const int PROCESSING_VIDEO_HEIGHT_LIMIT = 1200;
// TODO change the maximum video height
const int PROCESSING_VIDEO_HEIGHT_LIMIT = 2160;
// Blob size restrictions. Blobs outside of this range will be ignored.
const int MIN_BLOB_AREA = 1 * 1;
int MAX_BLOB_AREA;
};
#endif /* SETTINGS_HPP */