(nusc, sample)
| 43 | |
| 44 | |
| 45 | def get_sample_image(nusc, sample): |
| 46 | images = {} |
| 47 | file_rel_paths = {} |
| 48 | for camera_name in camera_types: |
| 49 | camera_data = nusc.get('sample_data', sample['data'][camera_name]) |
| 50 | file_rel_path = camera_data['filename'] |
| 51 | file_abs_path = osp.join(nusc.dataroot, file_rel_path) |
| 52 | image = cv2.imread(file_abs_path, cv2.IMREAD_COLOR) |
| 53 | if image is None: |
| 54 | print('Error: Could not read image.', file_abs_path) |
| 55 | return None |
| 56 | image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) |
| 57 | images[camera_name] = image |
| 58 | file_rel_paths[camera_name] = file_rel_path |
| 59 | return images, file_rel_paths |
| 60 | |
| 61 | |
| 62 | def get_transformations(nusc, sample): |
no outgoing calls
no test coverage detected