123456789101112131415161718192021222324 |
- import open3d as o3d
- import numpy as np
- def pcd_to_binary(pcd_file, output_file):
- pcd = o3d.io.read_point_cloud(pcd_file)
- points = np.asarray(pcd.points)
- binary_data = points[:, :3]
- with open(output_file, 'wb') as f:
- f.write(binary_data.tobytes())
- if __name__ == '__main__':
- pcd_to_binary(r'/home/tong/renyuan_pointcloud/4/trans/trans.pcd', r'/home/tong/renyuan_pointcloud/4/trans/pointcloud.txt')
-
-
|