vprdb.io
The io
submodule allows to read datasets from the hard disk and export them.
Datasets format
To use the tool, your data must be in a specific format
- Color images in any format
- Depth images in 16-bit grayscale format or point clouds in
.pcd
format. The depth images must match the color images pixel by pixel (and therefore have the same resolution). You should also know the intrinsic parameters of the camera and the depth scale if you use depth images - The trajectory containing one pose in each line in
timestamp tx ty tz qx qy qz qw
format. Timestamp is an optional argument that is not used in the library
Thus, the tool supports the TUM format for datasets.
The correspondence between poses, depth images, and color images is determined based on the order of lines in the trajectory file and the alphabetical order of the files.
Therefore, the structure of the dataset should look like this:
Example dataset
├── color
| ├── 001.png
| ├── 002.png
| ├── ...
├── depth
| ├── 001.pcd or 001.png
| ├── 002.pcd or 002.png
| ├── ...
└── CameraTrajectory.txt
The number of color images, depth images (or PCDs) and poses in the trajectory file must be the same. The names of folders and the trajectory file are configurable.
1# Copyright (c) 2023, Ivan Moskalenko, Anastasiia Kornilova 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14""" 15The `io` submodule allows to read datasets from the hard disk and export them. 16## Datasets format 17To use the tool, your data must be in a specific format 18* Color images in any format 19* Depth images in 16-bit grayscale format or point clouds in `.pcd` format. 20The depth images must match the color images pixel by pixel (and therefore have the same resolution). 21You should also know the intrinsic parameters of the camera and the depth scale if you use depth images 22* The trajectory containing one pose in each line in `timestamp tx ty tz qx qy qz qw` format. 23Timestamp is an optional argument that is not used in the library 24 25Thus, the tool supports the [TUM](https://cvg.cit.tum.de/data/datasets/rgbd-dataset/file_formats) format for datasets. 26 27The correspondence between poses, depth images, and color images 28is determined based on the order of lines in the trajectory file and the alphabetical order of the files. 29 30Therefore, the structure of the dataset should look like this: 31``` 32Example dataset 33├── color 34| ├── 001.png 35| ├── 002.png 36| ├── ... 37├── depth 38| ├── 001.pcd or 001.png 39| ├── 002.pcd or 002.png 40| ├── ... 41└── CameraTrajectory.txt 42``` 43The number of color images, depth images (or PCDs) and poses 44in the trajectory file must be the same. The names of folders and the trajectory file are configurable. 45""" 46from vprdb.io.export_utils import export 47from vprdb.io.read_utils import read_dataset_from_depth, read_dataset_from_point_clouds