diff options
-rw-r--r-- | src/argaze/TobiiGlassesPro2/TobiiVideo.py | 1 | ||||
-rw-r--r-- | src/argaze/utils/calibrate_tobii_camera.py | 11 | ||||
-rw-r--r-- | src/argaze/utils/track_aruco_rois_with_tobii_glasses.py | 9 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/argaze/TobiiGlassesPro2/TobiiVideo.py b/src/argaze/TobiiGlassesPro2/TobiiVideo.py index babc30b..b927b7f 100644 --- a/src/argaze/TobiiGlassesPro2/TobiiVideo.py +++ b/src/argaze/TobiiGlassesPro2/TobiiVideo.py @@ -78,7 +78,6 @@ class TobiiVideoThread(threading.Thread): return frame_copy, width_copy, height_copy, time_copy, pts_copy - def read_pts_buffer(self): """Get Presentation Time Stamp data buffer.""" diff --git a/src/argaze/utils/calibrate_tobii_camera.py b/src/argaze/utils/calibrate_tobii_camera.py index c50b499..553632f 100644 --- a/src/argaze/utils/calibrate_tobii_camera.py +++ b/src/argaze/utils/calibrate_tobii_camera.py @@ -61,10 +61,11 @@ def main(): expected_markers_number = len(aruco_board.get_ids()) expected_corners_number = (aruco_board.get_size()[0] - 1 ) * (aruco_board.get_size()[1] - 1) - # running until keyboard interruption + # capture loop try: - while True: + # wait 1ms between each frame until 'Esc' key is pressed + while cv.waitKey(1) != 27: # capture frame with a full displayed board frame, frame_width, frame_height, frame_time, frame_pts = tobii_video_thread.read() @@ -88,11 +89,9 @@ def main(): # append data aruco_camera.store_calibration_data(aruco_tracker.get_board_corners(), aruco_tracker.get_board_corners_ids()) - cv.imshow(f'Tobii Camera Calibration', frame) + cv.imshow('Tobii Camera Calibration', frame) - time.sleep(2) - - # exit on keyboard interruption + # exit on 'ctrl+C' interruption except KeyboardInterrupt: pass diff --git a/src/argaze/utils/track_aruco_rois_with_tobii_glasses.py b/src/argaze/utils/track_aruco_rois_with_tobii_glasses.py index 82e25bc..334a6bb 100644 --- a/src/argaze/utils/track_aruco_rois_with_tobii_glasses.py +++ b/src/argaze/utils/track_aruco_rois_with_tobii_glasses.py @@ -64,10 +64,11 @@ def main(): roi2D_buffer = [] marker_buffer = [] - # running until keyboard interruption + # tracking loop try: - while True: + # wait 1ms between each frame until 'Esc' key is pressed + while cv.waitKey(1) != 27: frame, frame_width, frame_height, frame_time, pts = tobii_video_thread.read() @@ -126,9 +127,9 @@ def main(): } marker_buffer.append(marker) - cv.imshow(f'Live Scene', frame) + cv.imshow('Live Scene', frame) - # exit on keyboard interruption + # exit on 'ctrl+C' interruption except KeyboardInterrupt: pass |