aboutsummaryrefslogtreecommitdiff
path: root/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py')
-rw-r--r--src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py b/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py
index 7231384..1723f1c 100644
--- a/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py
+++ b/src/argaze/ArUcoMarkers/ArUcoMarkersGroup.py
@@ -16,8 +16,7 @@ __credits__ = []
__copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)"
__license__ = "GPLv3"
-from typing import TypeVar, Tuple
-from dataclasses import dataclass, field
+from typing import Self
import json
import math
import itertools
@@ -35,9 +34,6 @@ T0 = numpy.array([0., 0., 0.])
R0 = numpy.array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]])
"""Define no rotation matrix."""
-ArUcoMarkersGroupType = TypeVar('ArUcoMarkersGroup', bound="ArUcoMarkersGroup")
-# Type definition for type annotation convenience
-
def make_rotation_matrix(x, y, z):
# Create rotation matrix around x axis
@@ -205,7 +201,7 @@ class ArUcoMarkersGroup(DataFeatures.PipelineStepObject):
}
@classmethod
- def from_obj(self, obj_filepath: str) -> ArUcoMarkersGroupType:
+ def from_obj(self, obj_filepath: str) -> Self:
"""Load ArUco markers group from .obj file.
!!! note
@@ -322,7 +318,7 @@ class ArUcoMarkersGroup(DataFeatures.PipelineStepObject):
return ArUcoMarkersGroup(new_dictionary, new_places)
- def filter_markers(self, detected_markers: dict) -> Tuple[dict, dict]:
+ def filter_markers(self, detected_markers: dict) -> tuple[dict, dict]:
"""Sort markers belonging to the group from given detected markers dict (cf ArUcoDetector.detect_markers()).
Returns:
@@ -345,7 +341,7 @@ class ArUcoMarkersGroup(DataFeatures.PipelineStepObject):
return group_markers, remaining_markers
- def estimate_pose_from_markers_corners(self, markers: dict, K: numpy.array, D: numpy.array) -> Tuple[bool, numpy.array, numpy.array]:
+ def estimate_pose_from_markers_corners(self, markers: dict, K: numpy.array, D: numpy.array) -> tuple[bool, numpy.array, numpy.array]:
"""Estimate pose from markers corners and places corners.
Parameters: