-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
56 lines (53 loc) · 2.16 KB
/
config.py
File metadata and controls
56 lines (53 loc) · 2.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
from dotmap import DotMap
from planvec.color_range import HSVColorRange
config_dict = {
'window': {
'title': 'Matt\'s PlanVec GUI!',
'left': 50,
'top': 50,
'full_screen': True,
'width': 1700, # if not full screen
'height': 700 # if not full screen
},
'video': {
'camera': 'USB', # either 'USB' or 'BUILTIN'
'max_input_width': 1920, # high res: 1920, low res: 640
'max_input_height': 1080, # high res: 1080, low res: 480
'raw_display_width': 250,
'raw_display_height': 181,
'processed_display_width': 650,
'processed_display_height': 650,
'frame_buffer_size': 1
},
'color_range': {
# 'blue': #HSVColorRange([91, 100, 20], [160, 255, 255]),
'red_low': HSVColorRange([0, 71, 71], [5, 255, 255]),
'red_high': HSVColorRange([165, 60, 60], [179, 255, 255]),
'green': HSVColorRange([15, 20, 30], [60, 225, 225]),
},
'processing': {
'rectify_shape': (1920, int(1920 * 0.7)),
'gaussian_blur': (3, 3),
'img_threshold': (100, 255),
'area_threshold': 5000,
'contours_size_threshold': 100,
'polygon_tolerance': 1,
'line_width': 1,
'out_size_inches': (7.87402, 5.51181), # TODO: fix scaling
},
'pdf_output': {
'plate_width_cm': 80,
'plate_height_cm': 50,
'draw_area_width_cm': 20,
'draw_area_height_cm': 14
},
'data': {
'overwrite_output': False,
'output_location': 'desktop' # can be either 'desktop' or 'repository'
}
}
# DotMap: This enables config access like...
# from planvec.config import CONFIG
# x_blur, y_blur = CONFIG.processing.gaussian_blur
# TODO: This is not really satisfactory
planvec_config = DotMap(config_dict)