Input and output functions¶
-
kontiki.io.
load_structure
(fileobj, group_name='structure')¶ Load SfM structure (Views and Landmarks)
Parameters: - location (str, Path, h5py.File, or h5py.Group) – If path or str, it opens that HDF5 file. If HDF5 group then data is loaded from that node.
- group_name (str) – Name of the HDF5 group where the structure is stored.
Returns: - views (list of View) – The views
- landmarks (list of Landmark) – Landmarks representing 3D poitns
- landmark_colors (dict) – Maps landmark to 8-bit RGB color
-
kontiki.io.
load_trajectory
(location, group_name='trajectory')¶ Load trajectory from HDF5 file
Parameters: - location (str, Path, h5py.File, or h5py.Group) – If path or str, it opens that HDF5 file. If HDF5 group then data is loaded from that node.
- group_name (str) – The name of the group under which the trajectory is stored. If location is a path it is a group directly under the root.
Returns: trajectory
Return type: A kontiki trajectory instance
-
kontiki.io.
save_structure
(fileobj, landmarks, *, group_name='structure', landmark_colors=None)¶ Save SfM structure (Views and Landmarks) in HDF5 file format
Parameters: - location (str, Path, h5py.File, or h5py.Group) – If path or str, it creates a new file. If HDF5 group the data is stored below that node.
- landmarks (list of landmarks) – Landmarks to save. It will save only the views and observations that are associated with these landmarks
- group_name (str) – Name of the HDF5 group where the structure is saved.
-
kontiki.io.
save_trajectory
(location, trajectory, group_name='trajectory')¶ Save trajectory to HDF5 file
Parameters: - location (str, Path, h5py.File, or h5py.Group) – If path or str, it creates a new file. If HDF5 group the data is stored below that node.
- trajectory (A kontiki Trajectory) – The trajectory to save
- group_name (str) – Name of the group where the trajectory is saved. If location is a path, it is a group under the root, otherwise it is created as a subgroup of the location.