aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2024-05-29 14:18:50 +0200
committerThéo de la Hogue2024-05-29 14:18:50 +0200
commit17edda946d70f8b4ce6400d7a08cc1f757ec6983 (patch)
tree35c6196399d34960e7773316ea8f333191642fc8
parent15cacb17bd0ce27e5e8c90b8f29fd2affe301d8d (diff)
downloadargaze-17edda946d70f8b4ce6400d7a08cc1f757ec6983.zip
argaze-17edda946d70f8b4ce6400d7a08cc1f757ec6983.tar.gz
argaze-17edda946d70f8b4ce6400d7a08cc1f757ec6983.tar.bz2
argaze-17edda946d70f8b4ce6400d7a08cc1f757ec6983.tar.xz
Adding a not_looked method to ArFrame.
-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