From 17edda946d70f8b4ce6400d7a08cc1f757ec6983 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 29 May 2024 14:18:50 +0200 Subject: Adding a not_looked method to ArFrame. --- src/argaze/ArFeatures.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py index ba602de..4e19466 100644 --- a/src/argaze/ArFeatures.py +++ b/src/argaze/ArFeatures.py @@ -781,6 +781,20 @@ class ArFrame(DataFeatures.SharedObject, DataFeatures.PipelineStepObject): layer.look(self.__identified_gaze_movement) + def not_looked(self): + """ + Tell the frame it is not looked currently + """ + + # Use frame lock feature + with self._lock: + + # No gaze position + self.__calibrated_gaze_position = GazeFeatures.GazePosition() + + # No gaze movement identified + self.__identified_gaze_movement = GazeFeatures.GazeMovement() + @DataFeatures.PipelineStepImage def image(self, background_weight: float = None, heatmap_weight: float = None, draw_gaze_position_calibrator: dict = None, draw_scan_path: dict = None, draw_layers: dict = None, draw_gaze_positions: dict = None, draw_fixations: dict = None, draw_saccades: dict = None) -> numpy.array: """ @@ -1409,6 +1423,7 @@ class ArCamera(ArFrame): # TODO?: Should we prefer to use camera frame AOIMatcher object? if aoi_2d.contains_point(timestamped_gaze_position): + inner_x, inner_y = aoi_2d.clockwise().inner_axis(*timestamped_gaze_position) # QUESTION: How to project gaze precision? @@ -1417,6 +1432,11 @@ class ArCamera(ArFrame): # Project inner gaze position into scene frame scene_frame.look(inner_gaze_position * scene_frame.size) + else: + + # Tell the frame it is not looked currently + scene_frame.not_looked() + # Ignore missing aoi in camera frame layer projection except KeyError: pass -- cgit v1.1