diff options
author | Théo de la Hogue | 2024-04-25 15:31:23 +0200 |
---|---|---|
committer | Théo de la Hogue | 2024-04-25 15:31:23 +0200 |
commit | 8b97c9949fce67239a2ee01a5591e11767c5dd87 (patch) | |
tree | ab5448fc8de895930e522fa9e2e578d079a50f76 | |
parent | da17ef741517b3d4453511c2c0bb62e3e0716ed3 (diff) | |
download | argaze-8b97c9949fce67239a2ee01a5591e11767c5dd87.zip argaze-8b97c9949fce67239a2ee01a5591e11767c5dd87.tar.gz argaze-8b97c9949fce67239a2ee01a5591e11767c5dd87.tar.bz2 argaze-8b97c9949fce67239a2ee01a5591e11767c5dd87.tar.xz |
Checking gaze movement type in DeviationCircleCoverage AOI matching algorithm.
-rw-r--r-- | src/argaze/GazeAnalysis/DeviationCircleCoverage.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py index 2138899..3d910c7 100644 --- a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py +++ b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py @@ -22,6 +22,7 @@ import numpy from argaze import GazeFeatures, DataFeatures from argaze.AreaOfInterest import AOIFeatures +from argaze.GazeAnalysis import DispersionThresholdIdentification, VelocityThresholdIdentification class AOIMatcher(GazeFeatures.AOIMatcher): @@ -70,8 +71,23 @@ class AOIMatcher(GazeFeatures.AOIMatcher): for name, aoi in aoi_scene.items(): - # BAD: we use deviation_max attribute which is an attribute of DispersionThresholdIdentification.Fixation class - region, _, circle_ratio = aoi.circle_intersection(gaze_movement.focus, gaze_movement.deviation_max) + # DispersionThresholdIdentification.Fixation: use maximal deviation + if issubclass(type(gaze_movement), DispersionThresholdIdentification.Fixation): + + fixation_circle_radius = gaze_movement.deviation_max + + # VelocityThresholdIdentification.Fixation: use amplitude + elif issubclass(type(gaze_movement), VelocityThresholdIdentification.Fixation): + + fixation_circle_radius = gaze_movement.amplitude + + # Otherwise, compute maximal deviation + else: + + fixation_circle_radius = max(gaze_movement.distances(gaze_movement.focus)) + + # Intersect + region, _, circle_ratio = aoi.circle_intersection(gaze_movement.focus, fixation_circle_radius) if name not in self.exclude and circle_ratio > self.__coverage_threshold: |