From 236160c812a09a56103dee5249f9cc1dd9c2673c Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Tue, 5 Sep 2023 08:01:11 +0200 Subject: Testing look_data to handle locked case. Updating variable names and comments. --- src/argaze/utils/demo_augmented_reality_run.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/argaze/utils/demo_augmented_reality_run.py b/src/argaze/utils/demo_augmented_reality_run.py index 14ddd36..c3492b3 100644 --- a/src/argaze/utils/demo_augmented_reality_run.py +++ b/src/argaze/utils/demo_augmented_reality_run.py @@ -50,10 +50,12 @@ def main(): for frame, look_data in aruco_camera.look(timestamp, GazeFeatures.GazePosition((x, y))): # Unpack look data - gaze_movement, scan_step_analysis, layer_analysis, execution_times, exception = look_data + if look_data: - # Do something with look data - # ... + gaze_movement, scan_step_analysis, layer_analysis, execution_times, exception = look_data + + # Do something with look data + # ... # Attach mouse callback to window cv2.setMouseCallback(aruco_camera.name, on_mouse_event) @@ -75,7 +77,7 @@ def main(): # Detect and project AR features detection_time, exceptions = aruco_camera.detect_and_project(video_image) - # Get ArUcoCamera image + # Get ArUcoCamera frame image aruco_camera_image = aruco_camera.image() # Write detection fps @@ -89,14 +91,14 @@ def main(): cv2.rectangle(aruco_camera_image, (0, (i+1)*50), (720, (i+2)*50), (127, 127, 127), -1) cv2.putText(aruco_camera_image, f'{scene_name} error: {e}', (20, (i+1)*90), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 1, cv2.LINE_AA) - # Display ArUcoCamera image + # Display ArUcoCamera frame image cv2.imshow(aruco_camera.name, aruco_camera_image) - # Draw and display each frames - for frame in aruco_camera.frames: + # Draw and display each scene frames + for scene_frame in aruco_camera.scene_frames: - # Display frame - cv2.imshow(f'{frame.parent.name}:{frame.name}', frame.image()) + # Display scene frame + cv2.imshow(f'{scene_frame.parent.name}:{scene_frame.name}', scene_frame.image()) # Stop by pressing 'Esc' key if cv2.waitKey(10) == 27: -- cgit v1.1