Reputation: 589
How can I convert a 4d numpy array to a pcd file? Open3d appears to let you save 3 dimensions but not a fourth(intensity).
Upvotes: 3
Views: 5390
Reputation: 151
It should be possible using the open3d.t namespace:
import open3d as o3d
import numpy as np
xyzi = np.random.rand(100, 4)
xyz = xyzi[:,0:3]
i = [[i] for i in xyzi[:,3]]
pcd = o3d.t.geometry.PointCloud()
pcd.point["positions"] = o3d.core.Tensor(xyz)
pcd.point["intensities"] = o3d.core.Tensor(i)
o3d.t.io.write_point_cloud("pointcloud.pcd", pcd)
For more info see this thread.
Upvotes: 5