Skip to content

Commit

Permalink
Update calibration_gui.py
Browse files Browse the repository at this point in the history
finally added optional reading of different target files
  • Loading branch information
alexlib committed Jun 15, 2024
1 parent 1c14fe0 commit ddfbd22
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pyptv/calibration_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,22 @@ def protect_ori_files(self):
# self.camera[i].update_image(images[i])

def _read_cal_points(self):

with open(self.calParams.fixp_name, 'r') as file:
first_line = file.readline()
if ',' in first_line:
delimiter=','
elif '\t' in first_line:
delimiter='\t'
elif ' ' in first_line:
delimiter=' '
else:
raise ValueError("Unsupported delimiter")

return np.atleast_1d(
np.loadtxt(
self.calParams.fixp_name,
delimiter=delimiter,
dtype=[("id", "i4"), ("pos", "3f8")],
skiprows=0,
)
Expand Down

0 comments on commit ddfbd22

Please sign in to comment.