3

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).

2
  • which program do you expect to read the 4d data back in ? and where do you get those values from ? Commented Mar 6, 2022 at 13:44
  • it is a simple txt format, similar to pcl you can write your own exporter in a few lines of code Commented Mar 6, 2022 at 13:49

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.