aboutsummaryrefslogtreecommitdiff
path: root/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/argaze/utils/export_tobii_segment_aruco_visual_scan.py')
-rw-r--r--src/argaze/utils/export_tobii_segment_aruco_visual_scan.py16
1 files changed, 13 insertions, 3 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 7a270f3..6c34ba9 100644
--- a/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py
+++ b/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py
@@ -161,7 +161,7 @@ def main():
try:
# Initialise progress bar
- MiscFeatures.printProgressBar(0, tobii_segment_video.get_duration(), 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():
@@ -239,7 +239,7 @@ def main():
# Update Progress Bar
progress = video_ts_ms - int(args.time_range[0] * 1000)
- MiscFeatures.printProgressBar(progress, tobii_segment_video.get_duration(), 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:
@@ -250,7 +250,13 @@ def main():
# End output video file
output_video.close()
- print(f'\nVisual scan video saved into {vs_video_filepath}')
+
+ # Print aruco tracking metrics
+ print('\nAruco marker tracking metrics')
+ try_count, tracked_counts = aruco_tracker.get_track_metrics()
+
+ for marker_id, tracked_count in tracked_counts.items():
+ print(f'Markers {marker_id} has been detected in {tracked_count} / {try_count} frames ({round(100 * tracked_count / try_count, 2)} %)')
# Build visual scan based on a pointer position
visual_scan = GazeFeatures.PointerBasedVisualScan(ts_aois_scenes, ts_gaze_positions)
@@ -264,6 +270,10 @@ def main():
cv.imwrite(vs_visu_filepath, visu_frame)
print(f'Visual scan image saved into {vs_visu_filepath}')
+ # Notify where the visual scan video has been exported
+ print(f'Visual scan video saved into {vs_video_filepath}')
+
+
if __name__ == '__main__':
main() \ No newline at end of file