MCPcopy Create free account
hub / github.com/AutonomousVehicleLaboratory/SemVecNet / get_sample_image

Function get_sample_image

tools/nusc_semantic_mapping.py:45–59  ·  view source on GitHub ↗
(nusc, sample)

Source from the content-addressed store, hash-verified

43
44
45def 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
62def get_transformations(nusc, sample):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected