aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/ArFeatures.py20
1 files changed, 20 insertions, 0 deletions
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