From 4d0de7c804914a55977635ec6bc46beb0cf7808a Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 17 Apr 2024 13:32:51 +0200 Subject: Renaming ArUcoMarkers into ArUcoMarker --- .../ArUcoMarkers/ArUcoOpticCalibrator.py | 61 ---------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/argaze.test/ArUcoMarkers/ArUcoOpticCalibrator.py (limited to 'src/argaze.test/ArUcoMarkers/ArUcoOpticCalibrator.py') diff --git a/src/argaze.test/ArUcoMarkers/ArUcoOpticCalibrator.py b/src/argaze.test/ArUcoMarkers/ArUcoOpticCalibrator.py deleted file mode 100644 index 79d2ead..0000000 --- a/src/argaze.test/ArUcoMarkers/ArUcoOpticCalibrator.py +++ /dev/null @@ -1,61 +0,0 @@ -""" - -This program is free software: you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation, either version 3 of the License, or (at your option) any later -version. -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License along with -this program. If not, see . -""" - -__author__ = "Théo de la Hogue" -__credits__ = [] -__copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)" -__license__ = "GPLv3" - -import unittest -import os - -from argaze.ArUcoMarkers import ArUcoOpticCalibrator - -import numpy - -class TestOpticParametersClass(unittest.TestCase): - """Test OpticParameters class.""" - - def test_new(self): - """Test OpticParameters creation.""" - - # Check defaut optic parameters creation - optic_parameters = ArUcoOpticCalibrator.OpticParameters() - - # Check ArUco optic parameters - self.assertEqual(optic_parameters.rms, 0.0) - - #self.assertEqual(type(optic_parameters.K), numpy.array) - - self.assertIsNone(numpy.testing.assert_array_equal(optic_parameters.dimensions, [0, 0])) - self.assertIsNone(numpy.testing.assert_array_equal(optic_parameters.K, ArUcoOpticCalibrator.K0)) - self.assertIsNone(numpy.testing.assert_array_equal(optic_parameters.D, ArUcoOpticCalibrator.D0)) - - def test_from_json(self): - - # Edit optic parameters file path - current_directory = os.path.dirname(os.path.abspath(__file__)) - json_filepath = os.path.join(current_directory, 'utils/optic_parameters.json') - - # Load optic parameters - optic_parameters = ArUcoOpticCalibrator.OpticParameters.from_json(json_filepath) - - # Check ArUco camera - self.assertEqual(optic_parameters.rms, 1.0) - self.assertIsNone(numpy.testing.assert_array_equal(optic_parameters.dimensions, [1920, 1080])) - self.assertIsNone(numpy.testing.assert_array_equal(optic_parameters.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(optic_parameters.D, [-1.0, -0.5, 0.0, 0.5, 1.0])) - -if __name__ == '__main__': - - unittest.main() \ No newline at end of file -- cgit v1.1