diff options
author | Théo de la Hogue | 2023-03-14 17:51:17 +0100 |
---|---|---|
committer | Théo de la Hogue | 2023-03-14 17:51:17 +0100 |
commit | ec6030d79f044a35d0bef0fdfb25e56a9c2e29b1 (patch) | |
tree | 78ef58201e1089eeb505e12ac543760dbcc7bec7 /src/argaze/ArUcoMarkers | |
parent | cb74bbc61e64c4971a61a8a1328bd62418244795 (diff) | |
download | argaze-ec6030d79f044a35d0bef0fdfb25e56a9c2e29b1.zip argaze-ec6030d79f044a35d0bef0fdfb25e56a9c2e29b1.tar.gz argaze-ec6030d79f044a35d0bef0fdfb25e56a9c2e29b1.tar.bz2 argaze-ec6030d79f044a35d0bef0fdfb25e56a9c2e29b1.tar.xz |
Changing and testing ArUcoScene class.
Diffstat (limited to 'src/argaze/ArUcoMarkers')
-rw-r--r-- | src/argaze/ArUcoMarkers/ArUcoScene.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoScene.py b/src/argaze/ArUcoMarkers/ArUcoScene.py index 63aa136..795bfe4 100644 --- a/src/argaze/ArUcoMarkers/ArUcoScene.py +++ b/src/argaze/ArUcoMarkers/ArUcoScene.py @@ -38,14 +38,28 @@ class Place(): class ArUcoScene(): """Handle group of ArUco markers as one unique spatial entity and estimate its pose.""" - def __init__(self, dictionary: ArUcoMarkersDictionary.ArUcoMarkersDictionary, marker_size: float, data_places: dict | str = None): + def __init__(self, marker_size: float, places: dict | str, dictionary: ArUcoMarkersDictionary.ArUcoMarkersDictionary = None): """Define scene attributes.""" - self.__dictionary = dictionary + # Init expected marker size self.__marker_size = marker_size + # Handle dictionary str or instance + if dictionary != None: + + if type(dictionary) == str: + self.__dictionary = ArUcoMarkersDictionary.ArUcoMarkersDictionary(dictionary) + elif isinstance(dictionary, ArUcoMarkersDictionary.ArUcoMarkersDictionary): + self.__dictionary = dictionary + else: + raise ValueError(f'dictionary: {dictionary}') + + else: + + self.__dictionary = ArUcoMarkersDictionary.ArUcoMarkersDictionary() + # NEVER USE {} as default function argument - self.places = data_places + self.places = places @property def places(self) -> dict: |