diff options
author | Théo de la Hogue | 2023-06-28 15:29:44 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-06-28 15:29:44 +0200 |
commit | 40c339f7f153537a419dade38fd7cbafa2d411ba (patch) | |
tree | bb71556b338a497264fb7cbc1f5960e8400074b3 /src | |
parent | 295c030296fa53ead244399d61544aee0f2c899b (diff) | |
download | argaze-40c339f7f153537a419dade38fd7cbafa2d411ba.zip argaze-40c339f7f153537a419dade38fd7cbafa2d411ba.tar.gz argaze-40c339f7f153537a419dade38fd7cbafa2d411ba.tar.bz2 argaze-40c339f7f153537a419dade38fd7cbafa2d411ba.tar.xz |
Adding abstract draw method to GazeMovement class.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/GazeFeatures.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index 65afdf8..14d4f62 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -274,6 +274,11 @@ class GazeMovement(): # Draw movement from start to next cv2.line(image, (int(start_gaze_position[0]), int(start_gaze_position[1])), (int(next_gaze_position[0]), int(next_gaze_position[1])), color, 1) + def draw(self, image: numpy.array, color): + """Draw gaze movement into image.""" + + raise NotImplementedError('draw() method not implemented') + class UnvalidGazeMovement(GazeMovement): """Unvalid gaze movement.""" @@ -283,6 +288,10 @@ class UnvalidGazeMovement(GazeMovement): super().__init__([]) + def draw(self, image: numpy.array, color): + + pass + FixationType = TypeVar('Fixation', bound="Fixation") # Type definition for type annotation convenience @@ -301,11 +310,6 @@ class Fixation(GazeMovement): raise NotImplementedError('merge() method not implemented') - def draw(self, image: numpy.array, color): - """Draw fixation into image.""" - - raise NotImplementedError('draw() method not implemented') - def is_fixation(gaze_movement): """Is a gaze movement a fixation?""" @@ -318,11 +322,6 @@ class Saccade(GazeMovement): super().__post_init__() - def draw(self, image: numpy.array, color): - """Draw saccade into image.""" - - raise NotImplementedError('draw() method not implemented') - def is_saccade(gaze_movement): """Is a gaze movement a saccade?""" |