diff options
author | Théo de la Hogue | 2022-12-07 16:19:57 +0100 |
---|---|---|
committer | Théo de la Hogue | 2022-12-07 16:19:57 +0100 |
commit | b7b1c65e0f0c9120c671866a4e0a242e24a4b06f (patch) | |
tree | 19872f1be60d7e860d11551cc92cbb0a8d1fcf04 /src | |
parent | a4c222f3c249b7fa2865f77516d9f46e52a6a655 (diff) | |
download | argaze-b7b1c65e0f0c9120c671866a4e0a242e24a4b06f.zip argaze-b7b1c65e0f0c9120c671866a4e0a242e24a4b06f.tar.gz argaze-b7b1c65e0f0c9120c671866a4e0a242e24a4b06f.tar.bz2 argaze-b7b1c65e0f0c9120c671866a4e0a242e24a4b06f.tar.xz |
Casting gaze position into integer before to draw.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/GazeFeatures.py | 7 |
1 files changed, 5 insertions, 2 deletions
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.""" |