diff options
author | Théo de la Hogue | 2022-09-21 15:58:13 +0200 |
---|---|---|
committer | Théo de la Hogue | 2022-09-21 15:58:13 +0200 |
commit | bbba702d02a21b74f9756561befaaeeafbe19515 (patch) | |
tree | 30b9cd3930e5dba3269b56689c43dd20ddb70b28 | |
parent | 0f190e6efae93924587440236b3592b9ff77ea05 (diff) | |
download | argaze-bbba702d02a21b74f9756561befaaeeafbe19515.zip argaze-bbba702d02a21b74f9756561befaaeeafbe19515.tar.gz argaze-bbba702d02a21b74f9756561befaaeeafbe19515.tar.bz2 argaze-bbba702d02a21b74f9756561befaaeeafbe19515.tar.xz |
Using GazePosition draw method.
-rw-r--r-- | src/argaze/utils/tobii_segment_display.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/argaze/utils/tobii_segment_display.py b/src/argaze/utils/tobii_segment_display.py index a106e7b..604ebcf 100644 --- a/src/argaze/utils/tobii_segment_display.py +++ b/src/argaze/utils/tobii_segment_display.py @@ -94,9 +94,6 @@ def main(): gaze_position_pixel = GazeFeatures.GazePosition( (int(nearest_gaze_position.value[0] * video_frame.width), int(nearest_gaze_position.value[1] * video_frame.height)) ) - # Draw gaze position - cv.circle(video_frame.matrix, gaze_position_pixel, 2, (0, 255, 255), -1) - # Get nearest gaze position 3D before video timestamp and remove all gaze positions before _, nearest_gaze_position_3d = tobii_ts_gaze_positions_3d.pop_first_until(video_ts) @@ -108,9 +105,9 @@ def main(): gaze_position_pixel.accuracy = round(video_frame.width * float(gaze_accuracy_mm) / float(tobii_camera_hfov_mm)) - # Draw gaze accuracy - cv.circle(video_frame.matrix, gaze_position_pixel, gaze_position_pixel.accuracy, (0, 255, 255), 1) - + # Draw gaze + gaze_position_pixel.draw(video_frame.matrix) + # Wait for gaze position except ValueError: pass @@ -138,13 +135,11 @@ def main(): cv.rectangle(video_frame.matrix, (0, 0), (550, 50), (63, 63, 63), -1) cv.putText(video_frame.matrix, f'Segment time: {int(video_ts_ms)} ms', (20, 40), cv.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv.LINE_AA) - if args.window: - - # Close window using 'Esc' key - if cv.waitKey(1) == 27: - break + # Close window using 'Esc' key + if cv.waitKey(1) == 27: + break - cv.imshow(f'Segment {tobii_segment.get_id()} video', video_frame.matrix) + cv.imshow(f'Segment {tobii_segment.get_id()} video', video_frame.matrix) # Update Progress Bar progress = video_ts_ms - int(args.time_range[0] * 1e3) |