diff options
author | Théo de la Hogue | 2024-03-11 17:18:42 +0100 |
---|---|---|
committer | Théo de la Hogue | 2024-03-11 17:18:42 +0100 |
commit | 6ebb4b5e418a0a69fce423eccfa35bcbb6502b70 (patch) | |
tree | 2da61e83bb619e5441c1b00bb8f0259c0474d608 /src/argaze.test/ArUcoMarkers | |
parent | 78d2f6801e2b1c80d4685c9fb3186c205b7dc9e6 (diff) | |
download | argaze-6ebb4b5e418a0a69fce423eccfa35bcbb6502b70.zip argaze-6ebb4b5e418a0a69fce423eccfa35bcbb6502b70.tar.gz argaze-6ebb4b5e418a0a69fce423eccfa35bcbb6502b70.tar.bz2 argaze-6ebb4b5e418a0a69fce423eccfa35bcbb6502b70.tar.xz |
removing property decorator to method that was not an object property but an object status.
Diffstat (limited to 'src/argaze.test/ArUcoMarkers')
-rw-r--r-- | src/argaze.test/ArUcoMarkers/ArUcoDetector.py | 34 | ||||
-rw-r--r-- | src/argaze.test/ArUcoMarkers/ArUcoScene.py | 4 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/argaze.test/ArUcoMarkers/ArUcoDetector.py b/src/argaze.test/ArUcoMarkers/ArUcoDetector.py index 403d1a6..06c56f5 100644 --- a/src/argaze.test/ArUcoMarkers/ArUcoDetector.py +++ b/src/argaze.test/ArUcoMarkers/ArUcoDetector.py @@ -51,8 +51,8 @@ class TestArUcoDetectorClass(unittest.TestCase): self.assertEqual(aruco_detector.dictionary.name, 'DICT_ARUCO_ORIGINAL') self.assertEqual(aruco_detector.marker_size, 3) self.assertIsNone(numpy.testing.assert_array_equal(aruco_detector.optic_parameters.dimensions, [0, 0])) - self.assertEqual(aruco_detector.detected_markers_number, 0) - self.assertEqual(aruco_detector.detected_markers, {}) + self.assertEqual(aruco_detector.detected_markers_number(), 0) + self.assertEqual(aruco_detector.detected_markers(), {}) aruco_dictionary = ArUcoMarkersDictionary.ArUcoMarkersDictionary('DICT_APRILTAG_16h5') aruco_detector = ArUcoDetector.ArUcoDetector(aruco_dictionary, 5.2) @@ -61,8 +61,8 @@ class TestArUcoDetectorClass(unittest.TestCase): self.assertEqual(aruco_detector.dictionary.name, 'DICT_APRILTAG_16h5') self.assertEqual(aruco_detector.marker_size, 5.2) self.assertIsNone(numpy.testing.assert_array_equal(aruco_detector.optic_parameters.dimensions, [0, 0])) - self.assertEqual(aruco_detector.detected_markers_number, 0) - self.assertEqual(aruco_detector.detected_markers, {}) + self.assertEqual(aruco_detector.detected_markers_number(), 0) + self.assertEqual(aruco_detector.detected_markers(), {}) def test_from_json(self): """Test ArUcoDetector creation.""" @@ -94,24 +94,24 @@ class TestArUcoDetectorClass(unittest.TestCase): # Check ArUcoMarker detection aruco_detector.detect_markers(image) - self.assertEqual(aruco_detector.detected_markers_number, 1) + self.assertEqual(aruco_detector.detected_markers_number(), 1) - self.assertEqual(aruco_detector.detected_markers[0].dictionary, aruco_detector.dictionary) - self.assertEqual(aruco_detector.detected_markers[0].identifier, 0) - self.assertEqual(aruco_detector.detected_markers[0].size, 3) + self.assertEqual(aruco_detector.detected_markers()[0].dictionary, aruco_detector.dictionary) + self.assertEqual(aruco_detector.detected_markers()[0].identifier, 0) + self.assertEqual(aruco_detector.detected_markers()[0].size, 3) # Check corner positions with -/+ 10 pixels precision - self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers[0].corners[0][0].astype(int), numpy.array([3823, 2073]), decimal=-1)) - self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers[0].corners[0][1].astype(int), numpy.array([4177, 2073]), decimal=-1)) - self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers[0].corners[0][2].astype(int), numpy.array([4177, 2427]), decimal=-1)) - self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers[0].corners[0][3].astype(int), numpy.array([3823, 2427]), decimal=-1)) + self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers()[0].corners[0][0].astype(int), numpy.array([3823, 2073]), decimal=-1)) + self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers()[0].corners[0][1].astype(int), numpy.array([4177, 2073]), decimal=-1)) + self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers()[0].corners[0][2].astype(int), numpy.array([4177, 2427]), decimal=-1)) + self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers()[0].corners[0][3].astype(int), numpy.array([3823, 2427]), decimal=-1)) # Check marker pose estimation aruco_detector.estimate_markers_pose([0]) # Check marker translation with -/+ 0.1 cm precision and rotation with -/+ 0.001 radian precision - self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers[0].translation, numpy.array([33.87, 19.05, 0.]), decimal=1)) - self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers[0].rotation, numpy.array([[1., 0., 0.], [0., -1., 0.], [0., 0., -1.]]), decimal=3)) + self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers()[0].translation, numpy.array([33.87, 19.05, 0.]), decimal=1)) + self.assertIsNone(numpy.testing.assert_almost_equal(aruco_detector.detected_markers()[0].rotation, numpy.array([[1., 0., 0.], [0., -1., 0.], [0., 0., -1.]]), decimal=3)) # Check detect metrics detect_count, markers_count = aruco_detector.detection_metrics @@ -131,9 +131,9 @@ class TestArUcoDetectorClass(unittest.TestCase): # Check ArUcoMarker board detection aruco_detector.detect_board(image, aruco_board, aruco_board.markers_number) - self.assertEqual(aruco_detector.board_corners_number, aruco_board.corners_number) - self.assertEqual(len(aruco_detector.board_corners), 24) - self.assertEqual(len(aruco_detector.board_corners_identifier), 24) + self.assertEqual(aruco_detector.board_corners_number(), aruco_board.corners_number) + self.assertEqual(len(aruco_detector.board_corners()), 24) + self.assertEqual(len(aruco_detector.board_corners_identifier()), 24) if __name__ == '__main__': diff --git a/src/argaze.test/ArUcoMarkers/ArUcoScene.py b/src/argaze.test/ArUcoMarkers/ArUcoScene.py index 628eac5..0d7b601 100644 --- a/src/argaze.test/ArUcoMarkers/ArUcoScene.py +++ b/src/argaze.test/ArUcoMarkers/ArUcoScene.py @@ -39,7 +39,7 @@ class TestArUcoMarkersGroupClass(unittest.TestCase): def setup_markers(self): # Prepare detected markers - self.detected_markers = { + self.detected_markers() = { 0: ArUcoMarker.ArUcoMarker('DICT_ARUCO_ORIGINAL', 0, 1.), 1: ArUcoMarker.ArUcoMarker('DICT_ARUCO_ORIGINAL', 1, 1.), 2: ArUcoMarker.ArUcoMarker('DICT_ARUCO_ORIGINAL', 2, 1.), @@ -47,7 +47,7 @@ class TestArUcoMarkersGroupClass(unittest.TestCase): } # Prepare scene markers and remaining markers - self.scene_markers, self.remaining_markers = self.aruco_markers_group.filter_markers(self.detected_markers) + self.scene_markers, self.remaining_markers = self.aruco_markers_group.filter_markers(self.detected_markers()) def test_new_from_obj(self): """Test ArUcoMarkersGroup creation.""" |