aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2024-07-22 18:03:17 +0200
committerThéo de la Hogue2024-07-22 18:03:17 +0200
commit4f2377b464f78e9efdf00dc2e5e0024f90fcc8a4 (patch)
tree39ed5113a843d78e0a2bd7117859882be4998a99
parent7c9b6f96f8359a2f8fd288635d23ab54c3abbef9 (diff)
downloadargaze-4f2377b464f78e9efdf00dc2e5e0024f90fcc8a4.zip
argaze-4f2377b464f78e9efdf00dc2e5e0024f90fcc8a4.tar.gz
argaze-4f2377b464f78e9efdf00dc2e5e0024f90fcc8a4.tar.bz2
argaze-4f2377b464f78e9efdf00dc2e5e0024f90fcc8a4.tar.xz
Timestamping camera images according sync_event too.
-rw-r--r--src/argaze/utils/contexts/TobiiProGlasses2.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/argaze/utils/contexts/TobiiProGlasses2.py b/src/argaze/utils/contexts/TobiiProGlasses2.py
index d9dbdea..13dcf4a 100644
--- a/src/argaze/utils/contexts/TobiiProGlasses2.py
+++ b/src/argaze/utils/contexts/TobiiProGlasses2.py
@@ -1303,8 +1303,19 @@ class SegmentPlayback(ArFeatures.DataPlaybackContext):
logging.debug('> read image at %i timestamp', video_ts)
- # Process camera image
- self._process_camera_image(timestamp=video_ts, image=video_image)
+ # Don't process images if sync is required but sync event not happened yet
+ if self.__sync_event is not None and self.__sync_ts is not None:
+
+ sync_video_ts = int(self.__sync_ts + video_ts - self.__sync_data_ts)
+
+ # Process camera image
+ self._process_camera_image(timestamp=sync_video_ts, image=video_image)
+
+ # Otherwise, always process images
+ elif self.__sync_event is None:
+
+ # Process camera image
+ self._process_camera_image(timestamp=video_ts, image=video_image)
height, width, _ = video_image.shape