Pointcloud Semantic Segmentation Saver¶
This script is used for creating custom datasets of lidar data with segmentation labels.
To generate lidar datasets for segmentation add Point Cloud Semantic Segmentation Saver script to the game object that has Raycast Lidar script. This game object represents a LiDAR (Light Detection and Ranging) sensor in the environment. By adding Point Cloud Semantic Segmentation Saver we can take point cloud data from this sensor and create labeled datasets ready for implementation of ML algorithms.
Object class represents a list of different class names that will be present in the dataset. Each Class Name can include multiple elements. These elements can be selected in the hierarchy and drag-and-droped in the Objects in Class element for quicker setup. Save Frequency Hz elements allow us to set the frequency of data acquisition in Hz. Save Path should be set to the full path where the data will be saved, and Namespace is the namespace that will be added to the name of every frame and label added to the dataset. Make sure to check the Enable option to start creating data.
This semantic segmentation tool was created to provide data similar to the data included in Kitti dataset. Currently we are saving pcd format which can be easily transformed into .bin files used in Kitti dataset with tools such as https://github.com/Yuseung-Na/pcd2bin)
This script also generates poses.txt which represents ground truth transformation of a position from initial state in every frame. Every line in poses.txt represents one frame and has 12 values. These values represent the coefficients of the homogenous transformation matrix:
r11 r12 r13 tx
r21 r22 r23 ty
r31 r32 r33 tz
0 0 0 1
represented as single row:
r11 r12 r13 tx r21 r22 r23 ty r31 r32 r33 tz
Data is saved in the form:
/dataset_folder/
├── run1/
│ ├── poses.txt
│ ├── labels/
│ │ ├ {namespace}_000000.txt
│ │ ├ {namespace}_000001.txt
│ │ .
│ │ .
│ └── lidar/
│ ├ {namespace}_000000.jpg
│ ├ {namespace}_000001.jpg
│ .
│ .
├── run2/
├── run3/
.
.
.
└── run21/