aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/ArFeatures.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py
index 03f57f6..0eba2e1 100644
--- a/src/argaze/ArFeatures.py
+++ b/src/argaze/ArFeatures.py
@@ -79,8 +79,21 @@ class ArEnvironment():
new_optic_parameters = ArUcoOpticCalibrator.OpticParameters(**optic_parameters_value)
- new_aruco_detecor_parameters = ArUcoDetector.DetectorParameters(**new_detector_data.pop('parameters'))
- new_aruco_detector = ArUcoDetector.ArUcoDetector(new_aruco_dictionary, new_marker_size, new_optic_parameters, new_aruco_detecor_parameters)
+ # Check detector parameters value type
+ detector_parameters_value = new_detector_data.pop('parameters')
+
+ # str: relative path to .json file
+ if type(detector_parameters_value) == str:
+
+ detector_parameters_value = os.path.join(working_directory, detector_parameters_value)
+ new_aruco_detector_parameters = ArUcoDetector.DetectorParameters.from_json(detector_parameters_value)
+
+ # dict:
+ else:
+
+ new_aruco_detector_parameters = ArUcoDetector.DetectorParameters(**new_detector_data.pop('parameters'))
+
+ new_aruco_detector = ArUcoDetector.ArUcoDetector(new_aruco_dictionary, new_marker_size, new_optic_parameters, new_aruco_detector_parameters)
new_scenes = {}
for scene_name, scene_data in data.pop('scenes').items():