From d6aafec46687e02fd961cda321c442ff179a8cc5 Mon Sep 17 00:00:00 2001 From: lm Date: Mon, 17 Jun 2024 15:01:00 +0200 Subject: [PATCH] fix alignement --- align-rec/aligner.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/align-rec/aligner.py b/align-rec/aligner.py index b25ffc2..f14c983 100644 --- a/align-rec/aligner.py +++ b/align-rec/aligner.py @@ -33,7 +33,9 @@ def align( t_micro = ( cap.get(cv2.CAP_PROP_POS_MSEC) * 1000 ) # Frame timestamp in microseconds - while inputs["time"][i] < t_micro: # Find the closest timestamp in inputs + while ( + inputs["time"][i] < t_micro and i < inputs.shape[0] - 1 + ): # Find the closest timestamp in inputs i += 1 # Pick the closest timestamp between the two neighbors