diff options
author | Théo de la Hogue | 2023-04-25 17:48:38 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-04-25 17:48:38 +0200 |
commit | 34b66cfa0ba454ad9d830e2b68dce4d4ce63882c (patch) | |
tree | 0999d2320040f69aeacfa6936888e26e8c4f5aa7 /src | |
parent | ac2928becb43ff6b35021dae2df8d1d81a30ec68 (diff) | |
download | argaze-34b66cfa0ba454ad9d830e2b68dce4d4ce63882c.zip argaze-34b66cfa0ba454ad9d830e2b68dce4d4ce63882c.tar.gz argaze-34b66cfa0ba454ad9d830e2b68dce4d4ce63882c.tar.bz2 argaze-34b66cfa0ba454ad9d830e2b68dce4d4ce63882c.tar.xz |
Adding color attribute.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/ArUcoMarkers/ArUcoMarker.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoMarker.py b/src/argaze/ArUcoMarkers/ArUcoMarker.py index f41810b..93d44e8 100644 --- a/src/argaze/ArUcoMarkers/ArUcoMarker.py +++ b/src/argaze/ArUcoMarkers/ArUcoMarker.py @@ -33,6 +33,9 @@ class ArUcoMarker(): points: numpy.array = field(init=False, repr=False) """Estimated 3D corners positions in camera world referential.""" + color: tuple = field(init=False, repr=False, default_factory=lambda : (0, 255, 0)) + """Color used to draw marker on frame.""" + @property def center(self) -> numpy.array: """Get 2D center position in camera image referential.""" @@ -57,7 +60,7 @@ class ArUcoMarker(): cv.drawFrameAxes(frame, numpy.array(K), numpy.array(D), self.rotation, self.translation, self.size) - aruco.drawDetectedMarkers(frame, [self.corners], numpy.array([self.identifier])) + aruco.drawDetectedMarkers(frame, [self.corners], numpy.array([self.identifier]), self.color) def save(self, destination_folder, dpi): """Save marker image as .png file into a destination folder.""" |