diff options
author | Théo de la Hogue | 2023-09-19 16:57:44 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-09-19 16:57:44 +0200 |
commit | 5de2df9ac8ce070fb0b608a3f02ed9aadb076745 (patch) | |
tree | 9fac07e947c8ad1066098b6d6a0cb9f697202146 | |
parent | c25bb1238fce5507607e5adabc0e3924b7e9e606 (diff) | |
download | argaze-5de2df9ac8ce070fb0b608a3f02ed9aadb076745.zip argaze-5de2df9ac8ce070fb0b608a3f02ed9aadb076745.tar.gz argaze-5de2df9ac8ce070fb0b608a3f02ed9aadb076745.tar.bz2 argaze-5de2df9ac8ce070fb0b608a3f02ed9aadb076745.tar.xz |
Resetting on unvalid gaze movement matching. Stopping coverage value trunc.
-rw-r--r-- | src/argaze/GazeAnalysis/DeviationCircleCoverage.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py index b59d2df..f0decfc 100644 --- a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py +++ b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py @@ -83,7 +83,10 @@ class AOIMatcher(GazeFeatures.AOIMatcher): for aoi_name, circle_ratio_sum in self.__circle_ratio_sum.items(): - self.__aois_coverages[aoi_name] = int(100 * circle_ratio_sum / self.__look_count) / 100 + circle_ratio_mean = circle_ratio_sum / self.__look_count + + # filter circle ration mean greater than 1 + self.__aois_coverages[aoi_name] = circle_ratio_mean if circle_ratio_mean < 1 else 1 # Update matched gaze movement self.__matched_gaze_movement = gaze_movement @@ -100,6 +103,10 @@ class AOIMatcher(GazeFeatures.AOIMatcher): self.__post_init__() + elif not gaze_movement.valid: + + self.__post_init__() + return (None, None) 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)): |