From b7b1c65e0f0c9120c671866a4e0a242e24a4b06f Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 7 Dec 2022 16:19:57 +0100 Subject: Casting gaze position into integer before to draw. --- src/argaze/GazeFeatures.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index de30735..d7fcb1a 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -44,6 +44,7 @@ class GazePosition(): def __array__(self): """Cast as numpy array.""" + return numpy.array(self.value) @property @@ -57,12 +58,14 @@ class GazePosition(): if self.valid: + int_value = (int(self.value[0]), int(self.value[1])) + # Draw point at position - cv.circle(frame, self.value, 2, color, -1) + cv.circle(frame, int_value, 2, color, -1) # Draw accuracy circle if self.accuracy > 0: - cv.circle(frame, self.value, round(self.accuracy), color, 1) + cv.circle(frame, int_value, round(self.accuracy), color, 1) class UnvalidGazePosition(GazePosition): """Unvalid gaze position.""" -- cgit v1.1