aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/utils/demo_gaze_features_run.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/argaze/utils/demo_gaze_features_run.py b/src/argaze/utils/demo_gaze_features_run.py
index 76d683a..7088639 100644
--- a/src/argaze/utils/demo_gaze_features_run.py
+++ b/src/argaze/utils/demo_gaze_features_run.py
@@ -10,7 +10,6 @@ __license__ = "BSD"
import argparse
import os
import time
-import queue
from argaze import ArFeatures, GazeFeatures
from argaze.AreaOfInterest import AOIFeatures
@@ -50,20 +49,14 @@ def main():
# Update pointer position
def on_mouse_event(event, x, y, flags, param):
- try:
+ # Edit millisecond timestamp
+ timestamp = int((time.time() - start_time) * 1e3)
- # Edit millisecond timestamp
- timestamp = int((time.time() - start_time) * 1e3)
+ # Project gaze position into frame
+ movement, scan_step_analysis, aoi_scan_step_analysis, times, exception = ar_frame.look(timestamp, GazeFeatures.GazePosition((x, y)))
- # Project gaze position into frame
- movement, scan_step_analysis, aoi_scan_step_analysis, times, exception = ar_frame.look(timestamp, GazeFeatures.GazePosition((x, y)))
-
- # Do something with look data
- # ...
-
- except GazeFeatures.AOIScanStepError as e:
-
- print(f'Error on {e.aoi} step:', e)
+ # Do something with look data
+ # ...
# Attach mouse callback to window
cv2.setMouseCallback(ar_frame.name, on_mouse_event)