-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathparams.py
executable file
·126 lines (87 loc) · 3.81 KB
/
params.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
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
import cv2
class Params(object):
def __init__(self):
self.pnp_min_measurements = 10
self.pnp_max_iterations = 10
self.init_min_points = 10
self.local_window_size = 10
self.ba_max_iterations = 10
self.min_tracked_points_ratio = 0.5
self.lc_min_inbetween_frames = 10 # frames
self.lc_max_inbetween_distance = 3 # meters
self.lc_embedding_distance = 22.0
self.lc_inliers_threshold = 15
self.lc_inliers_ratio = 0.5
self.lc_distance_threshold = 2 # meters
self.lc_max_iterations = 20
self.ground = False
self.view_camera_size = 1
class ParamsEuroc(Params):
def __init__(self, config='GFTT-BRIEF'):
super().__init__()
if config == 'GFTT-BRIEF':
self.feature_detector = cv2.GFTTDetector_create(
maxCorners=1000, minDistance=15.0,
qualityLevel=0.001, useHarrisDetector=False)
self.descriptor_extractor = cv2.xfeatures2d.BriefDescriptorExtractor_create(
bytes=32, use_orientation=False)
elif config == 'ORB-BRIEF':
self.feature_detector = cv2.ORB_create(
nfeatures=200, scaleFactor=1.2, nlevels=1, edgeThreshold=31)
self.descriptor_extractor = cv2.xfeatures2d.BriefDescriptorExtractor_create(
bytes=32, use_orientation=False)
else:
raise NotImplementedError
self.descriptor_matcher = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=False)
self.matching_cell_size = 15 # pixels
self.matching_neighborhood = 2
self.matching_distance = 25
self.frustum_near = 0.1 # meters
self.frustum_far = 50.0
self.lc_max_inbetween_distance = 4 # meters
self.lc_distance_threshold = 1.5
self.lc_embedding_distance = 22.0
self.view_image_width = 400
self.view_image_height = 250
self.view_camera_width = 0.1
self.view_viewpoint_x = 0
self.view_viewpoint_y = -1
self.view_viewpoint_z = -10
self.view_viewpoint_f = 2000
class ParamsKITTI(Params):
def __init__(self, config='GFTT-BRIEF'):
super().__init__()
if config == 'GFTT-BRIEF':
self.feature_detector = cv2.GFTTDetector_create(
maxCorners=1000, minDistance=12.0,
qualityLevel=0.001, useHarrisDetector=False)
self.descriptor_extractor = cv2.xfeatures2d.BriefDescriptorExtractor_create(
bytes=32, use_orientation=False)
elif config == 'GFTT-BRISK':
self.feature_detector = cv2.GFTTDetector_create(
maxCorners=2000, minDistance=15.0,
qualityLevel=0.01, useHarrisDetector=False)
self.descriptor_extractor = cv2.BRISK_create()
elif config == 'ORB-ORB':
self.feature_detector = cv2.ORB_create(
nfeatures=1000, scaleFactor=1.2, nlevels=1, edgeThreshold=31)
self.descriptor_extractor = self.feature_detector
else:
raise NotImplementedError
self.descriptor_matcher = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=False)
self.matching_cell_size = 15 # pixels
self.matching_neighborhood = 3
self.matching_distance = 30
self.frustum_near = 0.1 # meters
self.frustum_far = 1000.0
self.ground = True
self.lc_max_inbetween_distance = 50
self.lc_distance_threshold = 15
self.lc_embedding_distance = 20.0
self.view_image_width = 400
self.view_image_height = 130
self.view_camera_width = 0.75
self.view_viewpoint_x = 0
self.view_viewpoint_y = -500 # -10
self.view_viewpoint_z = -100 # -0.1
self.view_viewpoint_f = 2000