Skip to content

Commit df787b4

Browse files
committed
fix(cv_stereo_calib): adapted to new datasets #1009
1 parent 75af363 commit df787b4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

atom_evaluation/scripts/other_calibrations/cv_stereo_calib.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def cvStereoCalibrate(objp):
3737
image_points_r = np.ones((n_points, 2), np.float32)
3838
image_points_l = np.ones((n_points, 2), np.float32)
3939

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']):
4141
image_points_r[idx, 0] = point['x']
4242
image_points_r[idx, 1] = point['y']
4343

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']):
4545
image_points_l[idx, 0] = point['x']
4646
image_points_l[idx, 1] = point['y']
4747

@@ -133,8 +133,8 @@ def cvStereoCalibrate(objp):
133133
if sensor_key not in [left_camera, right_camera]:
134134
continue
135135

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:
138138
print(
139139
Fore.RED + 'Partial detection removed:' + Style.RESET_ALL + ' label from collection ' +
140140
collection_key + ', sensor ' + sensor_key)
@@ -148,8 +148,8 @@ def cvStereoCalibrate(objp):
148148
# remove collections which do not have a pattern detection for both cameras
149149
collections_to_delete = []
150150
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']:
153153
print('Collection ' + collection_key + ' pattern not detected on both cameras. Removing...')
154154
collections_to_delete.append(collection_key)
155155

0 commit comments

Comments
 (0)