aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/ArUcoMarkers/ArUcoCamera.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/argaze.test/ArUcoMarkers/ArUcoCamera.py')
-rw-r--r--src/argaze.test/ArUcoMarkers/ArUcoCamera.py52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/argaze.test/ArUcoMarkers/ArUcoCamera.py b/src/argaze.test/ArUcoMarkers/ArUcoCamera.py
deleted file mode 100644
index 7a53070..0000000
--- a/src/argaze.test/ArUcoMarkers/ArUcoCamera.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-
-""" """
-
-__author__ = "Théo de la Hogue"
-__credits__ = []
-__copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)"
-__license__ = "BSD"
-
-import unittest
-import os
-
-from argaze.ArUcoMarkers import ArUcoCamera
-
-import numpy
-
-class TestArUcoCameraClass(unittest.TestCase):
- """Test ArUcoCamera class."""
-
- def test_new(self):
- """Test ArUcoCamera creation."""
-
- # Check defaut camera creation
- aruco_camera = ArUcoCamera.ArUcoCamera()
-
- # Check ArUco camera
- self.assertEqual(aruco_camera.rms, 0.0)
-
- #self.assertEqual(type(aruco_camera.K), numpy.array)
-
- self.assertIsNone(numpy.testing.assert_array_equal(aruco_camera.dimensions, [0, 0]))
- self.assertIsNone(numpy.testing.assert_array_equal(aruco_camera.K, ArUcoCamera.K0))
- self.assertIsNone(numpy.testing.assert_array_equal(aruco_camera.D, ArUcoCamera.D0))
-
- def test_from_json(self):
-
- # Edit camera file path
- current_directory = os.path.dirname(os.path.abspath(__file__))
- json_filepath = os.path.join(current_directory, 'utils/camera.json')
-
- # Load camera calibration
- aruco_camera = ArUcoCamera.ArUcoCamera.from_json(json_filepath)
-
- # Check ArUco camera
- self.assertEqual(aruco_camera.rms, 1.0)
- self.assertIsNone(numpy.testing.assert_array_equal(aruco_camera.dimensions, [1920, 1080]))
- self.assertIsNone(numpy.testing.assert_array_equal(aruco_camera.K, [[1.0, 0.0, 1.0], [0.0, 1.0, 1.0], [0.0, 0.0, 1.0]]))
- self.assertIsNone(numpy.testing.assert_array_equal(aruco_camera.D, [-1.0, -0.5, 0.0, 0.5, 1.0]))
-
-if __name__ == '__main__':
-
- unittest.main() \ No newline at end of file