diff options
author | Théo de la Hogue | 2023-03-14 14:49:05 +0100 |
---|---|---|
committer | Théo de la Hogue | 2023-03-14 14:49:05 +0100 |
commit | 421fc1ee8b4b754df6af846f083b99d629c4fb6f (patch) | |
tree | 44d1054caf816cfe1453bd9cf1c1d8b460825d69 /src | |
parent | 27999659257ec15ebf6a598b65b47f3f19ddaaa8 (diff) | |
download | argaze-421fc1ee8b4b754df6af846f083b99d629c4fb6f.zip argaze-421fc1ee8b4b754df6af846f083b99d629c4fb6f.tar.gz argaze-421fc1ee8b4b754df6af846f083b99d629c4fb6f.tar.bz2 argaze-421fc1ee8b4b754df6af846f083b99d629c4fb6f.tar.xz |
Default ArUco Dictionary creation.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze.test/ArUcoMarkers/ArUcoMarkersDictionary.py | 11 | ||||
-rw-r--r-- | src/argaze/ArUcoMarkers/ArUcoMarkersDictionary.py | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/argaze.test/ArUcoMarkers/ArUcoMarkersDictionary.py b/src/argaze.test/ArUcoMarkers/ArUcoMarkersDictionary.py index 58849a6..e27580f 100644 --- a/src/argaze.test/ArUcoMarkers/ArUcoMarkersDictionary.py +++ b/src/argaze.test/ArUcoMarkers/ArUcoMarkersDictionary.py @@ -15,13 +15,20 @@ class TestArUcoMarkersDictionaryClass(unittest.TestCase): aruco_dictionary = ArUcoMarkersDictionary.ArUcoMarkersDictionary('BAD_DICT_NAME') - # Check DICT_ARUCO_ORIGINAL ArUcoMarkersDictionary creation - aruco_dictionary = ArUcoMarkersDictionary.ArUcoMarkersDictionary('DICT_ARUCO_ORIGINAL') + # Check default ArUcoMarkersDictionary creation + aruco_dictionary = ArUcoMarkersDictionary.ArUcoMarkersDictionary() self.assertEqual(aruco_dictionary.name, 'DICT_ARUCO_ORIGINAL') self.assertEqual(aruco_dictionary.format, '5X5') self.assertEqual(aruco_dictionary.number, 1024) + # Check DICT_APRILTAG_16h5 ArUcoMarkersDictionary creation + aruco_dictionary = ArUcoMarkersDictionary.ArUcoMarkersDictionary('DICT_APRILTAG_16h5') + + self.assertEqual(aruco_dictionary.name, 'DICT_APRILTAG_16h5') + self.assertEqual(aruco_dictionary.format, '4X4') + self.assertEqual(aruco_dictionary.number, 30) + if __name__ == '__main__': unittest.main()
\ No newline at end of file diff --git a/src/argaze/ArUcoMarkers/ArUcoMarkersDictionary.py b/src/argaze/ArUcoMarkers/ArUcoMarkersDictionary.py index 9be895b..8599293 100644 --- a/src/argaze/ArUcoMarkers/ArUcoMarkersDictionary.py +++ b/src/argaze/ArUcoMarkers/ArUcoMarkersDictionary.py @@ -37,7 +37,7 @@ ArUcoMarkerType = TypeVar('ArUcoMarker', bound="ArUcoMarker") class ArUcoMarkersDictionary(): """Handle an ArUco markers dictionary.""" - def __init__(self, name): + def __init__(self, name: str = 'DICT_ARUCO_ORIGINAL'): if all_aruco_markers_dictionaries.get(name, None) is None: raise NameError(f'Bad ArUco markers dictionary name: {name}') |