This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parameters.proto
238 lines (195 loc) · 8.42 KB
/
Parameters.proto
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
syntax = "proto2";
package package;
// ============================================== Data Structures ================================================
message FloatRange {
required float min = 1;
required float max = 2;
}
message ToggledFloatRange {
required bool enabled = 1;
required float min = 2;
required float max = 3;
}
message ToggledFloat {
required bool enabled = 1;
required float val = 2;
}
message ToggledInt {
required bool enabled = 1;
required int32 val = 2;
}
message IntPair {
required int32 x = 1;
required int32 y = 2;
}
message FloatPair {
required float x = 1;
required float y = 2;
}
message Image {
enum ImageFormat {
JPEG = 0;
BINARY = 1;
}
required ImageFormat format = 1;
optional bytes data = 2;
}
/* ============================================== Parameter Set ==============================================
The following message definition is processed by GeneratePhaseUI.py to generate PhaseController for SolaisTerminal.
Each field becomes one UI components, grouped into QGroupBoxes.
Group label: "// GROUP: <name>". Group name should be capitalized and must not contain spaces or special characters.
Supported types:
int32/int64 -> QDoubleSpinBox with 0 decimal
float/double -> QDoubleSpinBox with 2 decimal
ToggledInt -> QCheckBox + QDoubleSpinBox with 0 decimal
ToggledFloat -> QCheckBox + QDoubleSpinBox with 2 decimal
FloatRange -> 2 QDoubleSpinBox with 2 decimal
ToggledFloatRange -> QCheckBox + 2 QDoubleSpinBox with 2 decimal
IntPair -> 2 QDoubleSpinBox with 0 decimal
FloatPair -> 2 QDoubleSpinBox with 2 decimal
enumeration -> QComboBox
Every field must be followed by a comment, which is used as its label in UI.
Enum must start with index 0 and increment by 1.
All fields must be required.
*/
message ParamSet {
// GROUP: General
required int32 image_width = 1; // Input width
required int32 image_height = 2; // Image height
required int32 roi_width = 38; // ROI width
required int32 roi_height = 39; // ROI height
enum EnemyColor {
RED = 0;
BLUE = 1;
};
required EnemyColor enemy_color = 3; // Enemy color
required float video_speed = 4; // Video real speed
required float video_playback_speed = 5; // Video run speed
// GROUP: Input
enum CameraBackend {
OPENCV = 0;
MV_CAMERA = 1;
}
required CameraBackend camera_backend = 6; // Camera backend
required int32 camera_id = 7; // Camera ID
required int32 fps = 8; // FPS
required ToggledFloat gamma = 9; // Gamma
required ToggledInt manual_exposure = 10; // Manual exposure
// GROUP: Brightness_Color
required float brightness_threshold = 11; // Brightness threshold
enum ColorThresholdMode {
HSV = 0;
RB_CHANNELS = 1;
};
required ColorThresholdMode color_threshold_mode = 12; // Color threshold mode
required FloatRange hsv_red_hue = 13; // Red hue range (for HSV)
required FloatRange hsv_blue_hue = 14; // Blue hue range (for HSV)
required float rb_channel_threshold = 15; // RB threshold (for RB_CHANNELS)
// GROUP: Contours
required ToggledInt contour_erode = 16; // Erode (SLOW)
required ToggledInt contour_dilate = 17; // Dilate (SLOW)
required ToggledInt contour_open = 18; // Open (to reduce noise) (SLOW)
required ToggledInt contour_close = 19; // Close (to fill holes) (SLOW)
enum ContourFitFunction {
MIN_AREA_RECT = 0;
ELLIPSE = 1;
ELLIPSE_AMS = 2;
ELLIPSE_DIRECT = 3;
};
required ContourFitFunction contour_fit_function = 20; // Fit function
required ToggledFloat contour_pixel_count = 21; // Min contour pixel count
required ToggledFloat contour_min_area = 22; // Min contour area
required ToggledInt long_edge_min_length = 23; // Min length of the long edge
required ToggledFloatRange light_aspect_ratio = 24; // Aspect ratio range
required ToggledFloat light_max_rotation = 25; // min(angle, 180 - angle) <
// GROUP: Armors
required ToggledFloat light_length_max_ratio = 26; // Long light / short light <
required ToggledFloatRange light_x_dist_over_l = 27; // abs(X1 - X2) / avgL
required ToggledFloatRange light_y_dist_over_l = 28; // abs(Y1 - Y2) / avgL
required ToggledFloat light_angle_max_diff = 29; // abs(Angle1 - Angle2) [deg] <
required FloatRange small_armor_aspect_ratio = 30; // Small armor width/height range
required FloatRange large_armor_aspect_ratio = 31; // Large armor width/height range
required IntPair small_armor_size = 32; // Small armor region size [mm]
required IntPair large_armor_size = 33; // Large armor region size [mm]
required ToggledInt manual_pnp_rect_max_height = 44; // Use manual PnP rect when height <
required int32 dist_manual_offset = 45; // Manual distance offset
// GROUP: TopKiller
required float pulse_min_x_offset = 34; // Pulse min X offset [mm]
required float pulse_max_y_offset = 35; // Pulse max Y offset [mm]
required int32 pulse_min_interval = 43; // Min interval between pulses [ms]
required IntPair tk_threshold = 36; // Trigger TopKiller for X pulses in Y ms
required int32 tk_compute_period_using_pulses = 41; // TopKiller predicts using last X pulses
required float tk_target_dist_offset = 42; // TopKiller target distance offset [mm]
// GROUP: Aiming
required int32 tracking_life_time = 40; // Consider discard tracking after frames
required FloatPair manual_delta_offset = 37; // Manual angle offsets
}
// ============================================== Result Structures ==============================================
message ResultPoint2f {
required float x = 1;
required float y = 2;
}
message ResultPoint3f {
required float x = 1;
required float y = 2;
required float z = 3;
}
message ResultRotatedRect {
required ResultPoint2f center = 1;
required ResultPoint2f size = 2;
required float angle = 3;
}
message TopKillerPulse {
required ResultPoint3f mid_ypd = 1;
required int32 avg_time = 2;
required int32 frame_count = 3;
}
message ArmorInfo {
repeated ResultPoint2f image_points = 1;
required ResultPoint2f image_center = 2;
required ResultPoint3f offset = 3;
required bool large_armor = 5;
required int32 number = 6;
required bool selected = 7;
required ResultPoint3f ypd = 8;
}
/* ============================================== Result Package ==============================================
Special comments in the following message definition are processed by GeneratePhaseUI.py to generate PhaseController
for SolaisTerminal. Fields are not processed.
Group label: "// GROUP: <name>". Group name should be capitalized and must not contain spaces or special characters.
Supported option (at most one for each):
"// INFO: <name>" -> QLabel called "<name>Label"
"// IMAGE: <name>" -> QLabel called "<name>Label" + QImage* called "<name>"
Fields shall be optional or repeated.
*/
message Result {
// GROUP: Input
// INFO: cameraInfo
// IMAGE: cameraImage
optional string camera_info = 1; // Camera info
optional Image camera_image = 2; // Camera image
// GROUP: Brightness_Color
// IMAGE: brightnessImage
// IMAGE: colorImage
optional Image brightness_image = 3; // Brightness threshold image
optional Image color_image = 4; // Color threshold image
// GROUP: Contours
// INFO: contourInfo
// IMAGE: contourImage
optional Image contour_image = 5; // Contour image
repeated ResultRotatedRect lights = 6;
// GROUP: Armors
// INFO: armorInfo
// IMAGE: armorImage
repeated ArmorInfo armors = 7;
// GROUP: TopKiller
// INFO: topKillerInfo
// IMAGE: topKillerImage
optional bool tk_triggered = 8;
repeated TopKillerPulse tk_pulses = 9;
optional int32 tk_period = 12;
// GROUP: Aiming
// INFO: aimingInfo
optional ResultPoint2f aiming_target = 10;
optional int32 remaining_time_to_target = 11;
}