aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/ArUcoMarkers/ArUcoTracker.py
diff options
context:
space:
mode:
authorThéo de la Hogue2022-11-29 19:08:14 +0100
committerThéo de la Hogue2022-11-29 19:08:14 +0100
commit0a7154cbaa43bb14aae62fc4324ad24c60949472 (patch)
treea69ead795d156fe04cd2baddf245d54660c999c6 /src/argaze.test/ArUcoMarkers/ArUcoTracker.py
parent0b678204dbc733d199ddde1fc5dcaeb76c5af8a3 (diff)
downloadargaze-0a7154cbaa43bb14aae62fc4324ad24c60949472.zip
argaze-0a7154cbaa43bb14aae62fc4324ad24c60949472.tar.gz
argaze-0a7154cbaa43bb14aae62fc4324ad24c60949472.tar.bz2
argaze-0a7154cbaa43bb14aae62fc4324ad24c60949472.tar.xz
Renaming ArGazeProject into ArGazeScene. Removing useless old ArUcoSet related class.
Diffstat (limited to 'src/argaze.test/ArUcoMarkers/ArUcoTracker.py')
-rw-r--r--src/argaze.test/ArUcoMarkers/ArUcoTracker.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/argaze.test/ArUcoMarkers/ArUcoTracker.py b/src/argaze.test/ArUcoMarkers/ArUcoTracker.py
index acc0000..87373ea 100644
--- a/src/argaze.test/ArUcoMarkers/ArUcoTracker.py
+++ b/src/argaze.test/ArUcoMarkers/ArUcoTracker.py
@@ -9,6 +9,29 @@ from argaze.ArUcoMarkers import ArUcoMarkersDictionary, ArUcoCamera, ArUcoTracke
import cv2 as cv
import numpy
+class TestTrackingDataClass(unittest.TestCase):
+ """Test TrackingData class."""
+
+ def test_from_json(self):
+ """Test TrackingData creation from json file."""
+
+ # Edit traking data file path
+ current_directory = os.path.dirname(os.path.abspath(__file__))
+ json_filepath = os.path.join(current_directory, 'utils/tracker.json')
+
+ # Load project
+ tracking_data = ArUcoTracker.TrackingData.from_json(json_filepath)
+
+ # Check data
+ self.assertEqual(tracking_data.cornerRefinementMethod, 3)
+ self.assertEqual(tracking_data.aprilTagQuadSigma, 2)
+ self.assertEqual(tracking_data.aprilTagDeglitch, 1)
+
+ # Check bad data access fails
+ with self.assertRaises(AttributeError):
+
+ tracking_data.unknown_data = 1
+
class TestArUcoTrackerClass(unittest.TestCase):
"""Test ArUcoTracker class."""