From 6154711cb7dd1ab408af95d61988c5e242d8c713 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 23 Nov 2022 10:56:29 +0100 Subject: Allowing to launch aruco detection without aoi scene. --- src/argaze/utils/tobii_segment_aruco_aoi_export.py | 24 ++++++++++++---------- src/argaze/utils/tobii_stream_aruco_aoi_display.py | 18 ++++++++-------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/argaze/utils/tobii_segment_aruco_aoi_export.py b/src/argaze/utils/tobii_segment_aruco_aoi_export.py index 9f6ae78..7adba2f 100644 --- a/src/argaze/utils/tobii_segment_aruco_aoi_export.py +++ b/src/argaze/utils/tobii_segment_aruco_aoi_export.py @@ -124,21 +124,23 @@ def main(): aoi2D_visu_scenes = {} all_aois_names = [] - for marker_id, aoi_scene_filepath in args.marker_id_scene.items(): + if args.marker_id_scene != None: - marker_id = int(marker_id) - - aoi3D_scenes[marker_id] = AOI3DScene.AOI3DScene() - aoi3D_scenes[marker_id].load(aoi_scene_filepath) + for marker_id, aoi_scene_filepath in args.marker_id_scene.items(): - print(f'AOI in {os.path.basename(aoi_scene_filepath)} scene related to marker #{marker_id}:') - for aoi in aoi3D_scenes[marker_id].keys(): + marker_id = int(marker_id) + + aoi3D_scenes[marker_id] = AOI3DScene.AOI3DScene() + aoi3D_scenes[marker_id].load(aoi_scene_filepath) + + print(f'AOI in {os.path.basename(aoi_scene_filepath)} scene related to marker #{marker_id}:') + for aoi in aoi3D_scenes[marker_id].keys(): - print(f'\t{aoi}') + print(f'\t{aoi}') - # Store aoi name once - if aoi not in all_aois_names: - all_aois_names.append(aoi) + # Store aoi name once + if aoi not in all_aois_names: + all_aois_names.append(aoi) def aoi3D_scene_selector(marker_id): return aoi3D_scenes.get(marker_id, None) diff --git a/src/argaze/utils/tobii_stream_aruco_aoi_display.py b/src/argaze/utils/tobii_stream_aruco_aoi_display.py index c5becff..7eb5196 100644 --- a/src/argaze/utils/tobii_stream_aruco_aoi_display.py +++ b/src/argaze/utils/tobii_stream_aruco_aoi_display.py @@ -90,17 +90,19 @@ def main(): aoi3D_scenes = {} aoi2D_visu_scenes = {} - for marker_id, aoi_scene_filepath in args.marker_id_scene.items(): + if args.marker_id_scene != None: - marker_id = int(marker_id) - - aoi3D_scenes[marker_id] = AOI3DScene.AOI3DScene() - aoi3D_scenes[marker_id].load(aoi_scene_filepath) + for marker_id, aoi_scene_filepath in args.marker_id_scene.items(): - print(f'AOI in {os.path.basename(aoi_scene_filepath)} scene related to marker #{marker_id}:') - for aoi in aoi3D_scenes[marker_id].keys(): + marker_id = int(marker_id) + + aoi3D_scenes[marker_id] = AOI3DScene.AOI3DScene() + aoi3D_scenes[marker_id].load(aoi_scene_filepath) + + print(f'AOI in {os.path.basename(aoi_scene_filepath)} scene related to marker #{marker_id}:') + for aoi in aoi3D_scenes[marker_id].keys(): - print(f'\t{aoi}') + print(f'\t{aoi}') def aoi3D_scene_selector(marker_id): return aoi3D_scenes.get(marker_id, None) -- cgit v1.1