aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-08-30 23:25:50 +0200
committerThéo de la Hogue2023-08-30 23:25:50 +0200
commit6ba7d69e36cdae670d49897daa300d371fddfc42 (patch)
tree94c4d6a8dc410f3e162c9cc563990f4f7d5411bb /src
parent31df32870f06460be8069c171cb032f5aa74a098 (diff)
downloadargaze-6ba7d69e36cdae670d49897daa300d371fddfc42.zip
argaze-6ba7d69e36cdae670d49897daa300d371fddfc42.tar.gz
argaze-6ba7d69e36cdae670d49897daa300d371fddfc42.tar.bz2
argaze-6ba7d69e36cdae670d49897daa300d371fddfc42.tar.xz
Fixing code annotations.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/GazeAnalysis/DispersionThresholdIdentification.py13
-rw-r--r--src/argaze/GazeAnalysis/VelocityThresholdIdentification.py13
-rw-r--r--src/argaze/GazeFeatures.py2
3 files changed, 17 insertions, 11 deletions
diff --git a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
index 85f2fb5..15fddf4 100644
--- a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
+++ b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
@@ -99,17 +99,20 @@ class Saccade(GazeFeatures.Saccade):
def __post_init__(self):
super().__post_init__()
- def draw(self, image: numpy.array, line_color=(255, 255, 255)):
+ def draw(self, image: numpy.array, line_color: tuple = None):
"""Draw saccade into image.
Parameters:
- color: color of line from first position to last position
+ line_color: color of line from first position to last position
"""
- _, start_position = self.positions.first
- _, last_position = self.positions.last
+ # Draw line if required
+ if line_color is not None:
- cv2.line(image, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), line_color, 2)
+ _, start_position = self.positions.first
+ _, last_position = self.positions.last
+
+ cv2.line(image, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), line_color, 2)
@dataclass
class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
diff --git a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py
index ab90fe7..64931f5 100644
--- a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py
+++ b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py
@@ -98,17 +98,20 @@ class Saccade(GazeFeatures.Saccade):
def __post_init__(self):
super().__post_init__()
- def draw(self, image: numpy.array, line_color=(255, 255, 255)):
+ def draw(self, image: numpy.array, line_color: tuple = None):
"""Draw saccade into image.
Parameters:
- color: color of line from first position to last position
+ line_color: color of line from first position to last position
"""
- _, start_position = self.positions.first
- _, last_position = self.positions.last
+ # Draw line if required
+ if line_color is not None:
- cv2.line(image, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), line_color, 2)
+ _, start_position = self.positions.first
+ _, last_position = self.positions.last
+
+ cv2.line(image, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), line_color, 2)
@dataclass
class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py
index 4c377d1..c49dc09 100644
--- a/src/argaze/GazeFeatures.py
+++ b/src/argaze/GazeFeatures.py
@@ -672,7 +672,7 @@ class ScanPath(list):
self.__last_fixation = fixation
- def draw(self, image: numpy.array, draw_fixations: dict = None, draw_saccades: dict = None, deepness=0):
+ def draw(self, image: numpy.array, draw_fixations: dict = None, draw_saccades: dict = None, deepness: int = 0):
"""Draw scan path into image.
Parameters: