aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2022-12-07 16:26:22 +0100
committerThéo de la Hogue2022-12-07 16:26:22 +0100
commitbaf0ddabe03e0fa3e6a1f9d84b557a1af2a19439 (patch)
tree0bfe2e0c5522601a4c14e1dc3167715c8c36e28a
parentde8b62fa75ebca03f3af3ef5f4a65d765a58a4be (diff)
downloadargaze-baf0ddabe03e0fa3e6a1f9d84b557a1af2a19439.zip
argaze-baf0ddabe03e0fa3e6a1f9d84b557a1af2a19439.tar.gz
argaze-baf0ddabe03e0fa3e6a1f9d84b557a1af2a19439.tar.bz2
argaze-baf0ddabe03e0fa3e6a1f9d84b557a1af2a19439.tar.xz
Replacing pop_first_until by pop_last_before.
-rw-r--r--src/argaze/utils/tobii_segment_display.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/argaze/utils/tobii_segment_display.py b/src/argaze/utils/tobii_segment_display.py
index 344241d..8d8f037 100644
--- a/src/argaze/utils/tobii_segment_display.py
+++ b/src/argaze/utils/tobii_segment_display.py
@@ -63,7 +63,7 @@ def main():
try:
# Get nearest head rotation before video timestamp and remove all head rotations before
- _, nearest_head_rotation = tobii_ts_head_rotations.pop_first_until(video_ts)
+ _, nearest_head_rotation = tobii_ts_head_rotations.pop_last_before(video_ts)
# Calculate head movement considering only head yaw and pitch
head_movement = numpy.array(nearest_head_rotation.value)
@@ -80,7 +80,7 @@ def main():
try:
# Get nearest gaze position before video timestamp and remove all gaze positions before
- _, nearest_gaze_position = tobii_ts_gaze_positions.pop_first_until(video_ts)
+ _, nearest_gaze_position = tobii_ts_gaze_positions.pop_last_before(video_ts)
# Ignore frame when gaze position is not valid
if nearest_gaze_position.validity == 0:
@@ -88,7 +88,7 @@ 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)) )
# 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)
+ _, nearest_gaze_position_3d = tobii_ts_gaze_positions_3d.pop_last_before(video_ts)
# Ignore frame when gaze position 3D is not valid
if nearest_gaze_position_3d.validity == 0:
@@ -108,7 +108,7 @@ def main():
try:
# Get nearest event before video timestamp and remove all gaze positions before
- nearest_event_ts, nearest_event = tobii_ts_events.pop_first_until(video_ts)
+ nearest_event_ts, nearest_event = tobii_ts_events.pop_last_before(video_ts)
#print(nearest_event_ts / 1e3, nearest_event)