@@ -37,11 +37,11 @@ def cvStereoCalibrate(objp):
37
37
image_points_r = np .ones ((n_points , 2 ), np .float32 )
38
38
image_points_l = np .ones ((n_points , 2 ), np .float32 )
39
39
40
- for idx , point in enumerate (collection ['labels' ][right_camera ]['idxs' ]):
40
+ for idx , point in enumerate (collection ['labels' ][first_pattern_key ][ right_camera ]['idxs' ]):
41
41
image_points_r [idx , 0 ] = point ['x' ]
42
42
image_points_r [idx , 1 ] = point ['y' ]
43
43
44
- for idx , point in enumerate (collection ['labels' ][left_camera ]['idxs' ]):
44
+ for idx , point in enumerate (collection ['labels' ][first_pattern_key ][ left_camera ]['idxs' ]):
45
45
image_points_l [idx , 0 ] = point ['x' ]
46
46
image_points_l [idx , 1 ] = point ['y' ]
47
47
@@ -133,8 +133,8 @@ def cvStereoCalibrate(objp):
133
133
if sensor_key not in [left_camera , right_camera ]:
134
134
continue
135
135
136
- if sensor ['msg_type' ] == 'Image' and collection ['labels' ][sensor_key ]['detected' ]:
137
- if not len (collection ['labels' ][sensor_key ]['idxs' ]) == number_of_corners :
136
+ if sensor ['msg_type' ] == 'Image' and collection ['labels' ][first_pattern_key ][ sensor_key ]['detected' ]:
137
+ if not len (collection ['labels' ][first_pattern_key ][ sensor_key ]['idxs' ]) == number_of_corners :
138
138
print (
139
139
Fore .RED + 'Partial detection removed:' + Style .RESET_ALL + ' label from collection ' +
140
140
collection_key + ', sensor ' + sensor_key )
@@ -148,8 +148,8 @@ def cvStereoCalibrate(objp):
148
148
# remove collections which do not have a pattern detection for both cameras
149
149
collections_to_delete = []
150
150
for collection_key , collection in dataset ['collections' ].items ():
151
- if not collection ['labels' ][args ['left_camera' ]]['detected' ] or \
152
- not collection ['labels' ][args ['right_camera' ]]['detected' ]:
151
+ if not collection ['labels' ][first_pattern_key ][ args ['left_camera' ]]['detected' ] or \
152
+ not collection ['labels' ][first_pattern_key ][ args ['right_camera' ]]['detected' ]:
153
153
print ('Collection ' + collection_key + ' pattern not detected on both cameras. Removing...' )
154
154
collections_to_delete .append (collection_key )
155
155
0 commit comments