aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/utils/demo_gaze_features_run.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/argaze/utils/demo_gaze_features_run.py b/src/argaze/utils/demo_gaze_features_run.py
index 0efb232..8e8c282 100644
--- a/src/argaze/utils/demo_gaze_features_run.py
+++ b/src/argaze/utils/demo_gaze_features_run.py
@@ -37,9 +37,10 @@ def main():
window_name = "AOI Scene"
cv2.namedWindow(window_name, cv2.WINDOW_AUTOSIZE)
- # Init gaze movement identification
+ # Init gaze movements processing
gaze_position = GazeFeatures.GazePosition()
gaze_movement_identifier = DispersionBasedGazeMovementIdentifier.GazeMovementIdentifier(args.deviation_max_threshold, args.duration_min_threshold)
+ visual_scan = GazeFeatures.VisualScan()
gaze_movement_lock = threading.Lock()
# Init timestamp
@@ -69,6 +70,7 @@ def main():
if isinstance(gaze_movement, DispersionBasedGazeMovementIdentifier.Fixation):
# Does the fixation match an AOI?
+ look_at = 'Screen'
for name, aoi in aoi_scene_projection.items():
_, _, circle_ratio = aoi.circle_intersection(gaze_movement.centroid, args.deviation_max_threshold)
@@ -77,8 +79,16 @@ def main():
if name != 'Screen':
- print(f'{data_ts}: gaze step on {name} aoi')
- #gaze_step = GazeStep(gaze_movement, name)
+ look_at = name
+ break
+
+ # Append fixation to visual scan
+ new_arc = visual_scan.append_fixation(data_ts, gaze_movement, look_at)
+
+ if isinstance(gaze_movement, DispersionBasedGazeMovementIdentifier.Saccade):
+
+ # Append saccade to visual scan
+ visual_scan.append_saccade(data_ts, gaze_movement)
# Unlock gaze movement exploitation
gaze_movement_lock.release()