diff options
author | Théo de la Hogue | 2022-08-10 16:14:31 +0200 |
---|---|---|
committer | Théo de la Hogue | 2022-08-10 16:14:31 +0200 |
commit | bf6dc10237d16710726ade24d1eb422acc3dc11b (patch) | |
tree | 89db704ecb5a8e9d419bbf3624107d9fc8f8011c /src | |
parent | 096b596915ff21f004b6a1d7c402671db482af1a (diff) | |
download | argaze-bf6dc10237d16710726ade24d1eb422acc3dc11b.zip argaze-bf6dc10237d16710726ade24d1eb422acc3dc11b.tar.gz argaze-bf6dc10237d16710726ade24d1eb422acc3dc11b.tar.bz2 argaze-bf6dc10237d16710726ade24d1eb422acc3dc11b.tar.xz |
Defining generic focus area.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/utils/export_tobii_segment_aruco_visual_scan.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py b/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py index 4174949..721f8d7 100644 --- a/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py +++ b/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py @@ -175,7 +175,7 @@ def main(): try: # Initialise progress bar - MiscFeatures.printProgressBar(0, tobii_segment_video.get_duration()/1000, prefix = 'Progress:', suffix = 'Complete', length = 100) + #MiscFeatures.printProgressBar(0, tobii_segment_video.get_duration()/1000, prefix = 'Progress:', suffix = 'Complete', length = 100) # Iterate on video frames for video_ts, video_frame in tobii_segment_video.frames(): @@ -205,6 +205,9 @@ def main(): aruco_tracker.track(video_frame.matrix) aruco_tracker.draw(video_frame.matrix) + # Draw focus area + cv.circle(video_frame.matrix, (int(video_frame.width/2), int(video_frame.height/2)), int(video_frame.height/2), (255, 150, 150), 1) + # Project 3D scene on each video frame and the visualisation frame if aruco_tracker.get_markers_number(): @@ -218,14 +221,14 @@ def main(): if aoi3D_scene == None: continue - - # Ignore marker too far from center + + # Ignore marker out of focus area marker_x, marker_y = aruco_tracker.get_marker_center(i) distance_to_center = ( (video_frame.width/2 - marker_x)**2 + (video_frame.height/2 - marker_y)**2 )**0.5 - - if distance_to_center > 900: - continue + if distance_to_center > int(video_frame.height/2): + continue + aoi3D_scene.rotation = aruco_tracker.get_marker_rotation(i) aoi3D_scene.translation = aruco_tracker.get_marker_translation(i) @@ -281,7 +284,7 @@ def main(): # Update Progress Bar progress = video_ts_ms - int(args.time_range[0] * 1000) - MiscFeatures.printProgressBar(progress, tobii_segment_video.get_duration()/1000, prefix = 'Progress:', suffix = 'Complete', length = 100) + #MiscFeatures.printProgressBar(progress, tobii_segment_video.get_duration()/1000, prefix = 'Progress:', suffix = 'Complete', length = 100) # Exit on 'ctrl+C' interruption except KeyboardInterrupt: |