Skip to content

Commit

Permalink
allow non-integer calibration distances and be more lenient when pars…
Browse files Browse the repository at this point in the history
…ing calibration distances from filenames
  • Loading branch information
timmh committed Apr 29, 2024
1 parent 6f31bc5 commit 93341e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import argparse
import enum
import urllib.request
import re
import cv2
import numpy as np
from sklearn import linear_model
Expand Down Expand Up @@ -61,7 +62,7 @@ def get_calibration_frame_dist(transect_dir, calibration_frame_id):
"""Try to get metric depth belonging to a calibration frames using multiple methods"""
# first try wether the filename itself represents the distance in meters
try:
return int(calibration_frame_id)
return float(re.sub(r"[a-zA-Z]", "", calibration_frame_id))
except:
pass

Expand Down

0 comments on commit 93341e6

Please sign in to comment.