aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/utils/tobii_segment_aruco_aoi_edit.py2
-rw-r--r--src/argaze/utils/tobii_segment_aruco_aoi_export.py8
-rw-r--r--src/argaze/utils/tobii_segment_gaze_movements_export.py18
3 files changed, 14 insertions, 14 deletions
diff --git a/src/argaze/utils/tobii_segment_aruco_aoi_edit.py b/src/argaze/utils/tobii_segment_aruco_aoi_edit.py
index 469e61a..3899d9d 100644
--- a/src/argaze/utils/tobii_segment_aruco_aoi_edit.py
+++ b/src/argaze/utils/tobii_segment_aruco_aoi_edit.py
@@ -191,7 +191,7 @@ def main():
if frame_index != last_frame_index or force_update:
video_ts, video_frame = tobii_segment_video.get_frame(frame_index)
- video_ts_ms = video_ts / 1000
+ video_ts_ms = video_ts / 1e3
last_frame_index = frame_index
last_frame = video_frame.copy()
diff --git a/src/argaze/utils/tobii_segment_aruco_aoi_export.py b/src/argaze/utils/tobii_segment_aruco_aoi_export.py
index 5e19b40..d7a6e58 100644
--- a/src/argaze/utils/tobii_segment_aruco_aoi_export.py
+++ b/src/argaze/utils/tobii_segment_aruco_aoi_export.py
@@ -143,7 +143,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()/1e3, prefix = 'Progress:', suffix = 'Complete', length = 100)
head_moving = False
head_movement_last = 0.
@@ -151,7 +151,7 @@ def main():
# Iterate on video frames
for video_ts, video_frame in tobii_segment_video.frames():
- video_ts_ms = video_ts / 1000
+ video_ts_ms = video_ts / 1e3
# Copy video frame to edit visualisation on it without disrupting aruco tracking
visu_frame = video_frame.copy()
@@ -289,8 +289,8 @@ def main():
output_video.write(visu_frame.matrix)
# 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)
+ progress = video_ts_ms - int(args.time_range[0] * 1e3)
+ MiscFeatures.printProgressBar(progress, tobii_segment_video.get_duration()/1e3, prefix = 'Progress:', suffix = 'Complete', length = 100)
# Exit on 'ctrl+C' interruption
except KeyboardInterrupt:
diff --git a/src/argaze/utils/tobii_segment_gaze_movements_export.py b/src/argaze/utils/tobii_segment_gaze_movements_export.py
index 80e4836..d52b08b 100644
--- a/src/argaze/utils/tobii_segment_gaze_movements_export.py
+++ b/src/argaze/utils/tobii_segment_gaze_movements_export.py
@@ -103,12 +103,12 @@ def main():
gaze_position_pixel.accuracy = round(tobii_segment_video.get_width() * float(gaze_accuracy_mm) / float(tobii_camera_hfov_mm))
# Store gaze position using millisecond unit timestamp
- ts_gaze_positions[ts/1000] = gaze_position_pixel
+ ts_gaze_positions[ts/1e3] = gaze_position_pixel
continue
# Store unvalid gaze position for further movement processing
- ts_gaze_positions[ts/1000] = GazeFeatures.UnvalidGazePosition()
+ ts_gaze_positions[ts/1e3] = GazeFeatures.UnvalidGazePosition()
print(f'Movement identifier parameters:')
print(f'\tDispersion threshold = {args.dispersion_threshold}')
@@ -121,7 +121,7 @@ def main():
gaze_status = GazeFeatures.TimeStampedGazeStatus()
# Initialise progress bar
- MiscFeatures.printProgressBar(0, int(tobii_segment_video.get_duration()/1000), prefix = 'Movements identification:', suffix = 'Complete', length = 100)
+ MiscFeatures.printProgressBar(0, int(tobii_segment_video.get_duration()/1e3), prefix = 'Movements identification:', suffix = 'Complete', length = 100)
for item in movement_identifier:
@@ -149,8 +149,8 @@ def main():
continue
# Update Progress Bar
- progress = ts - int(args.time_range[0] * 1000)
- MiscFeatures.printProgressBar(progress, int(tobii_segment_video.get_duration()/1000), prefix = 'Movements identification:', suffix = 'Complete', length = 100)
+ progress = ts - int(args.time_range[0] * 1e3)
+ MiscFeatures.printProgressBar(progress, int(tobii_segment_video.get_duration()/1e3), prefix = 'Movements identification:', suffix = 'Complete', length = 100)
print(f'\n{len(fixations)} fixations and {len(saccades)} saccades found')
@@ -173,7 +173,7 @@ def main():
try:
# Initialise progress bar
- MiscFeatures.printProgressBar(0, tobii_segment_video.get_duration()/1000, prefix = 'Video with movements processing:', suffix = 'Complete', length = 100)
+ MiscFeatures.printProgressBar(0, tobii_segment_video.get_duration()/1e3, prefix = 'Video with movements processing:', suffix = 'Complete', length = 100)
current_fixation_ts, current_fixation = fixations.pop_first()
current_fixation_time_counter = 0
@@ -183,7 +183,7 @@ def main():
# Iterate on video frames
for video_ts, video_frame in tobii_segment_video.frames():
- video_ts_ms = video_ts / 1000
+ video_ts_ms = video_ts / 1e3
# Draw current fixation
if len(fixations) > 0:
@@ -244,8 +244,8 @@ def main():
output_video.write(video_frame.matrix)
# Update Progress Bar
- progress = video_ts_ms - int(args.time_range[0] * 1000)
- MiscFeatures.printProgressBar(progress, tobii_segment_video.get_duration()/1000, prefix = 'Video with movements processing:', suffix = 'Complete', length = 100)
+ progress = video_ts_ms - int(args.time_range[0] * 1e3)
+ MiscFeatures.printProgressBar(progress, tobii_segment_video.get_duration()/1e3, prefix = 'Video with movements processing:', suffix = 'Complete', length = 100)
# Exit on 'ctrl+C' interruption
except KeyboardInterrupt: