'Save 4d numpy array as pcd(point cloud) file
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).
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jacek Jaskólski |
