-
Notifications
You must be signed in to change notification settings - Fork 342
/
Copy pathparam_settings.py
63 lines (51 loc) · 1.92 KB
/
param_settings.py
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
import os
import cv2
camera_names = ["front", "back", "left", "right"]
# --------------------------------------------------------------------
# (shift_width, shift_height): how far away the birdview looks outside
# of the calibration pattern in horizontal and vertical directions
shift_w = 300
shift_h = 300
# size of the gap between the calibration pattern and the car
# in horizontal and vertical directions
inn_shift_w = 20
inn_shift_h = 50
# total width/height of the stitched image
total_w = 600 + 2 * shift_w
total_h = 1000 + 2 * shift_h
# four corners of the rectangular region occupied by the car
# top-left (x_left, y_top), bottom-right (x_right, y_bottom)
xl = shift_w + 180 + inn_shift_w
xr = total_w - xl
yt = shift_h + 200 + inn_shift_h
yb = total_h - yt
# --------------------------------------------------------------------
project_shapes = {
"front": (total_w, yt),
"back": (total_w, yt),
"left": (total_h, xl),
"right": (total_h, xl)
}
# pixel locations of the four points to be chosen.
# you must click these pixels in the same order when running
# the get_projection_map.py script
project_keypoints = {
"front": [(shift_w + 120, shift_h),
(shift_w + 480, shift_h),
(shift_w + 120, shift_h + 160),
(shift_w + 480, shift_h + 160)],
"back": [(shift_w + 120, shift_h),
(shift_w + 480, shift_h),
(shift_w + 120, shift_h + 160),
(shift_w + 480, shift_h + 160)],
"left": [(shift_h + 280, shift_w),
(shift_h + 840, shift_w),
(shift_h + 280, shift_w + 160),
(shift_h + 840, shift_w + 160)],
"right": [(shift_h + 160, shift_w),
(shift_h + 720, shift_w),
(shift_h + 160, shift_w + 160),
(shift_h + 720, shift_w + 160)]
}
car_image = cv2.imread(os.path.join(os.getcwd(), "images", "car.png"))
car_image = cv2.resize(car_image, (xr - xl, yb - yt))