point_labeler icon indicating copy to clipboard operation
point_labeler copied to clipboard

How to use this tool with only lidar data?And i can't open the .bin file.Thank you.

Open aprilliuwei opened this issue 2 years ago • 5 comments

Hello, first of all, thanks for you tool.I just want to make a lidar segmentation data set. Only lidar data is available. What should I do? And I can't open .bin files and other files, I can't use this tool, I really hope to get help. thanks. Screenshot from 2021-08-05 20-39-17

aprilliuwei avatar Aug 05 '21 12:08 aprilliuwei

The simplest way to get started with the tool is to bring your dataset in the format of the KITTI odometry data. As described in the Readme, the folder structure is as follows:

point cloud folder
├── velodyne/             -- directory containing ".bin" files with Velodyne point clouds.   
├── labels/   [optional]  -- label directory, will be generated if not present.  
├── image_2/  [optional]  -- directory containing ".png" files from the color   camera.  
├── calib.txt             -- calibration of velodyne vs. camera. needed for projection of point cloud into camera.  
└── poses.txt             -- file containing the poses of every scan.
  • The velodyne folder contains binary files for each scan, i.e., 00000.bin, 00001.bin, .... The format is very simple, it's just each point in the local coordinate frame of the sensor as x,y,z,remission represented as a float (e.g. np.float32 if you are familiar with numpy).

  • The calib.txt can be just a dummy file containing:

P0: 1 0 0 0 0 1 0 0 0 0 1 0
P1: 1 0 0 0 0 1 0 0 0 0 1 0
P2: 1 0 0 0 0 1 0 0 0 0 1 0
P3: 1 0 0 0 0 1 0 0 0 0 1 0
Tr: 1 0 0 0 0 1 0 0 0 0 1 0

This is just needed to use the original convention of KITTI that provides poses in the coordinate system of a camera.

  • The poses.txtcontains the global poses of the LiDAR sensor for each scan. We generated these using our surfel-based SLAM approach. Each line corresponds to the first 3 rows of a homogeneous transformation matrix, see https://github.com/jbehley/point_labeler/issues/44#issuecomment-866869168 for a more detailed description. These poses will be used to display multiple scans at the same time.

Hope that gets you started.

jbehley avatar Aug 07 '21 16:08 jbehley

Thank you very much for your reply. I did as you suggested. It seems that everything is ready, but when I prepare to label my dataset, it shows that the label file cannot be opened, as shown in Figure 1 (shouldn't the label file be generated automatically after labeling?), On the contrary, when I load the data of the label file, it displays as shown in Figure 2, and no point cloud is displayed. Thank you again. Screenshot from 2021-08-09 16-29-35 Screenshot from 2021-08-09 16-32-28

aprilliuwei avatar Aug 09 '21 08:08 aprilliuwei

You always open the based directory containing the velodyne folder. You have to ensure that the bin files contains exactly 4*number of points floats, since the number of points is inferred from the file size:

      std::ifstream in(velodyne_filenames_[i].c_str());
      in.seekg(0, std::ios::end);
      uint32_t num_points = in.tellg() / (4 * sizeof(float));
      in.close();

If there is no labels directory, then the program will first create a directory and create for each point cloud in the velodyne directory a corresponding .label file. This will then be later used.

If there is a mismatch between the number of points in the corresponding .bin file and the number of labels in the .label file, you will get the error in your second figure. (If you start just fresh, I would suggest to simply delete the labels folder.)

Ensure that you have enough disk space (such that the files are not truncated.), since the initialize of KittiReader will generate for each point cloud a corresponding label file if it does not exist.

jbehley avatar Aug 09 '21 23:08 jbehley

Thank you for your help. It runs successfully. I'm trying to use this tool to label point cloud data. Thank you again.

aprilliuwei avatar Aug 11 '21 08:08 aprilliuwei

When I used kitti's data set and strictly followed the format you suggested, the following problems appeared. What is the problem? Screenshot from 2021-08-23 09-15-22

aprilliuwei avatar Aug 23 '21 01:08 aprilliuwei