diff options
author | Théo de la Hogue | 2023-06-21 09:03:41 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-06-21 09:03:41 +0200 |
commit | a594afb5bb17798cd138f1632dcfc53f4eaac09f (patch) | |
tree | ac3527627e4171e6fd545c73e0cc81f49dfe6a94 /src/argaze/GazeAnalysis | |
parent | 0354377903fbc8a828b5735b2d25e1c5bc02c768 (diff) | |
download | argaze-a594afb5bb17798cd138f1632dcfc53f4eaac09f.zip argaze-a594afb5bb17798cd138f1632dcfc53f4eaac09f.tar.gz argaze-a594afb5bb17798cd138f1632dcfc53f4eaac09f.tar.bz2 argaze-a594afb5bb17798cd138f1632dcfc53f4eaac09f.tar.xz |
Replacing frame word by image when it is about drawing or detecting.
Diffstat (limited to 'src/argaze/GazeAnalysis')
-rw-r--r-- | src/argaze/GazeAnalysis/DispersionThresholdIdentification.py | 14 | ||||
-rw-r--r-- | src/argaze/GazeAnalysis/VelocityThresholdIdentification.py | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py index c79b4fc..1883d69 100644 --- a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py +++ b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py @@ -78,11 +78,11 @@ class Fixation(GazeFeatures.Fixation): return self - def draw(self, frame: numpy.array, color=(127, 127, 127), border_color=(255, 255, 255)): - """Draw fixation into frame.""" + def draw(self, image: numpy.array, color=(127, 127, 127), border_color=(255, 255, 255)): + """Draw fixation into image.""" - cv2.circle(frame, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), color, -1) - cv2.circle(frame, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), border_color, len(self.positions)) + cv2.circle(image, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), color, -1) + cv2.circle(image, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), border_color, len(self.positions)) @dataclass(frozen=True) class Saccade(GazeFeatures.Saccade): @@ -91,13 +91,13 @@ class Saccade(GazeFeatures.Saccade): def __post_init__(self): super().__post_init__() - def draw(self, frame: numpy.array, color=(255, 255, 255)): - """Draw saccade into frame.""" + def draw(self, image: numpy.array, color=(255, 255, 255)): + """Draw saccade into image.""" _, start_position = self.positions.first _, last_position = self.positions.last - cv2.line(frame, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), color, 2) + cv2.line(image, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), color, 2) @dataclass class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier): diff --git a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py index 32af1c5..7d6c7b2 100644 --- a/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py +++ b/src/argaze/GazeAnalysis/VelocityThresholdIdentification.py @@ -78,11 +78,11 @@ class Fixation(GazeFeatures.Fixation): return self - def draw(self, frame: numpy.array, color=(127, 127, 127), border_color=(255, 255, 255)): - """Draw fixation into frame.""" + def draw(self, image: numpy.array, color=(127, 127, 127), border_color=(255, 255, 255)): + """Draw fixation into image.""" - cv2.circle(frame, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), color, -1) - cv2.circle(frame, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), border_color, len(self.positions)) + cv2.circle(image, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), color, -1) + cv2.circle(image, (int(self.focus[0]), int(self.focus[1])), int(self.deviation_max), border_color, len(self.positions)) @dataclass(frozen=True) class Saccade(GazeFeatures.Saccade): @@ -91,13 +91,13 @@ class Saccade(GazeFeatures.Saccade): def __post_init__(self): super().__post_init__() - def draw(self, frame: numpy.array, color=(255, 255, 255)): - """Draw saccade into frame.""" + def draw(self, image: numpy.array, color=(255, 255, 255)): + """Draw saccade into image.""" _, start_position = self.positions.first _, last_position = self.positions.last - cv2.line(frame, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), color, 2) + cv2.line(image, (int(start_position[0]), int(start_position[1])), (int(last_position[0]), int(last_position[1])), color, 2) @dataclass class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier): |