aboutsummaryrefslogtreecommitdiff
path: root/src/argaze/GazeAnalysis/DeviationCircleCoverage.py
diff options
context:
space:
mode:
authorThéo de la Hogue2023-09-13 21:53:16 +0200
committerThéo de la Hogue2023-09-13 21:53:16 +0200
commitb754fdd9f3c74bad33f4a3952268c99ce49c5193 (patch)
tree5d54f710f0be51868578e8261e6c748389ce0bdb /src/argaze/GazeAnalysis/DeviationCircleCoverage.py
parente23f36b3f15f291daed077dc7d04d07939f1b7ed (diff)
downloadargaze-b754fdd9f3c74bad33f4a3952268c99ce49c5193.zip
argaze-b754fdd9f3c74bad33f4a3952268c99ce49c5193.tar.gz
argaze-b754fdd9f3c74bad33f4a3952268c99ce49c5193.tar.bz2
argaze-b754fdd9f3c74bad33f4a3952268c99ce49c5193.tar.xz
Allowing to update looked aoi in aoi matcher drawing method.
Diffstat (limited to 'src/argaze/GazeAnalysis/DeviationCircleCoverage.py')
-rw-r--r--src/argaze/GazeAnalysis/DeviationCircleCoverage.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py
index 7b230c4..22da916 100644
--- a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py
+++ b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py
@@ -102,10 +102,12 @@ class AOIMatcher(GazeFeatures.AOIMatcher):
return (None, None)
- def draw(self, image: numpy.array, draw_matched_fixation: dict = None, draw_matched_fixation_positions: dict = None, draw_matched_region: dict = None, draw_looked_aoi: dict = None, looked_aoi_name_color: tuple = None, looked_aoi_name_offset: tuple = (0, 0)):
+ def draw(self, image: numpy.array, aoi_scene: AOIFeatures.AOIScene, draw_matched_fixation: dict = None, draw_matched_fixation_positions: dict = None, draw_matched_region: dict = None, draw_looked_aoi: dict = None, update_looked_aoi: bool = False, looked_aoi_name_color: tuple = None, looked_aoi_name_offset: tuple = (0, 0)):
"""Draw matching into image.
Parameters:
+ image: where to draw
+ aoi_scene: to refresh looked aoi if required
draw_matched_fixation: Fixation.draw parameters (which depends of the loaded gaze movement identifier module, if None, no fixation is drawn)
draw_matched_fixation_positions: GazeMovement.draw_positions parameters (if None, no fixation is drawn)
draw_matched_region: AOIFeatures.AOI.draw parameters (if None, no matched region is drawn)
@@ -131,6 +133,16 @@ class AOIMatcher(GazeFeatures.AOIMatcher):
# Draw matched aoi
if self.looked_aoi.all() is not None:
+ if update_looked_aoi:
+
+ try:
+
+ self.__looked_aoi_data = (self.looked_aoi_name, aoi_scene[self.looked_aoi_name])
+
+ except KeyError:
+
+ pass
+
# Draw looked aoi if required
if draw_looked_aoi is not None: