aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/GazeFeatures.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py
index 717e01b..1c5f537 100644
--- a/src/argaze/GazeFeatures.py
+++ b/src/argaze/GazeFeatures.py
@@ -8,6 +8,7 @@ from argaze.AreaOfInterest import AOIFeatures
import numpy
import pandas
+import cv2 as cv
@dataclass
class GazePosition():
@@ -33,6 +34,15 @@ class GazePosition():
def __array__(self):
return numpy.array(self.value)
+ def draw(self, frame, color=(0, 255, 255)):
+
+ # Draw point at position
+ cv.circle(frame, self.value, 2, color, -1)
+
+ # Draw accuracy circle
+ if self.accuracy > 0:
+ cv.circle(frame, self.value, round(self.accuracy), color, 1)
+
class GazePositionMissing(GazePosition, Exception):
"""Exception to raise when gaze position is missing."""