From e1803530ca3b07dc0f2fdce68805e44195e38fa3 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 6 Sep 2023 11:28:44 +0200 Subject: Making scenes loading not mandatory. --- src/argaze/ArUcoMarkers/ArUcoCamera.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/argaze/ArUcoMarkers/ArUcoCamera.py b/src/argaze/ArUcoMarkers/ArUcoCamera.py index ad70391..30b4415 100644 --- a/src/argaze/ArUcoMarkers/ArUcoCamera.py +++ b/src/argaze/ArUcoMarkers/ArUcoCamera.py @@ -115,16 +115,23 @@ class ArUcoCamera(ArFeatures.ArCamera): # Load ArUcoScenes new_scenes = {} - for aruco_scene_name, aruco_scene_data in aruco_camera_data.pop('scenes').items(): - # Append name - aruco_scene_data['name'] = aruco_scene_name + try: + + for aruco_scene_name, aruco_scene_data in aruco_camera_data.pop('scenes').items(): + + # Append name + aruco_scene_data['name'] = aruco_scene_name - # Create new aruco scene - new_aruco_scene = ArUcoScene.ArUcoScene.from_dict(aruco_scene_data, working_directory) + # Create new aruco scene + new_aruco_scene = ArUcoScene.ArUcoScene.from_dict(aruco_scene_data, working_directory) + + # Append new scene + new_scenes[aruco_scene_name] = new_aruco_scene + + except KeyError: - # Append new scene - new_scenes[aruco_scene_name] = new_aruco_scene + pass # Set image_parameters to default if there is not if 'image_parameters' not in aruco_camera_data.keys(): -- cgit v1.1