aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-09-05 12:29:39 +0200
committerThéo de la Hogue2023-09-05 12:29:39 +0200
commit8a0210fc3b6135a91766dbf186a4e2e23f42b970 (patch)
treef9ad525ada1cd7d73c5cb67b6348d3ba84e1e531
parenta57fcf2b9357dd0c474642da29175af2ff1c7147 (diff)
downloadargaze-8a0210fc3b6135a91766dbf186a4e2e23f42b970.zip
argaze-8a0210fc3b6135a91766dbf186a4e2e23f42b970.tar.gz
argaze-8a0210fc3b6135a91766dbf186a4e2e23f42b970.tar.bz2
argaze-8a0210fc3b6135a91766dbf186a4e2e23f42b970.tar.xz
Loading JSON file descriptor.
-rw-r--r--src/argaze/ArUcoMarkers/ArUcoScene.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoScene.py b/src/argaze/ArUcoMarkers/ArUcoScene.py
index e128e0f..3bbd3f4 100644
--- a/src/argaze/ArUcoMarkers/ArUcoScene.py
+++ b/src/argaze/ArUcoMarkers/ArUcoScene.py
@@ -65,11 +65,21 @@ class ArUcoScene(ArFeatures.ArScene):
# Check aruco_markers_group value type
aruco_markers_group_value = aruco_scene_data.pop('aruco_markers_group')
- # str: relative path to .obj file
+ # str: relative path to description file
if type(aruco_markers_group_value) == str:
- aruco_markers_group_value = os.path.join(working_directory, aruco_markers_group_value)
- new_aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup.from_obj(aruco_markers_group_value)
+ filepath = os.path.join(working_directory, aruco_markers_group_value)
+ file_format = filepath.split('.')[-1]
+
+ # JSON file format
+ if file_format == 'json':
+
+ new_aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup.from_json(filepath)
+
+ # OBJ file format
+ elif file_format == 'obj':
+
+ new_aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup.from_obj(filepath)
# dict:
else: