Closed lhthq closed 5 months ago
Hello, may I ask why the points of the label file and the pcd file do not match, but this problem will not be solved after the algorithm processing?As shown in the figure, in the data set obtained from MCD's official website, the number of points in the pcd above is inconsistent with the number of points in the label below. However, the data used in your outram is the same, how do you handle this data?
@bear-rabbit Hi, could you give a little bit more detail about your situation? In MCD we provide the annotated scans in one single pcd file where the semantic label is included in the scalar file. But in your case, it seems you have the points and labels in two separate files.
@lhthq Hi, if you are testing Outram on the annotated Livox point clouds, there is no need for the conversion. You can just load the pcd files provided and the labels are naturally within.
@Pamphlett I use the mcd ntu01 rosbag to produce each scan pcd. And label pcd is used for extracting semantic label. But the two pcd have different point size. It means that i just need one single pcd file? Thanks
@bear-rabbit Hello!
Hope this helps!
@lhthq
Have you installed the pypcd package?
Using pypcd you can read the pcd into numpy array directly. Then if you want you can save numpy array as .bin quite easily. Example:
import numpy as np
from pypcd import pypcd
cloud = pypcd.PointCloud.from_path('/media/tmn/mySataSSD1/DATASETS/MCDVIRAL/MCDPointCloudLivoxSegmented/ntu_01_02_10_13/ntu_01_02_10_13_v06_exported/sequences/ntu_night_13/inW_labelled/cloud_0011.pcd').pc_data[['x', 'y', 'z', 'intensity', 'label']]
# Print the x, y, z and label of the first 10 points
print(cloud[['x', 'y', 'z', 'label']][0:10])
# Save the pointcloud as a structured array
cloud.tofile('/home/tmn/cloud_structured_array.bin')
# Save the pointcloud as a 2D array of dimension Nx5
cloud_2D = np.concatenate([cloud['x'].reshape(-1,1),
cloud['y'].reshape(-1,1),
cloud['z'].reshape(-1,1),
cloud['intensity'].reshape(-1,1),
cloud['label'].reshape(-1,1)], axis=1).astype(np.float32)
print(cloud_2D[0:10, :])
with open('/home/tmn/cloud_2D.bin', 'wb') as f:
cloud_2D[0:10, :].tofile('/home/tmn/cloud_2D.bin')
cloud_2D_short = np.fromfile('/home/tmn/cloud_2D.bin', dtype=np.float32).reshape(-1, 5)
print(cloud_2D_short)
Hi
Thanks for your interest in our work. We will update the script recently and I will let you know when it's done.