索引
一、说明
这里是引用
原理1
二、源码
import numpy as np
import laspy
import open3d as o3d
def pcd2las(file,save_path):
pcd = o3d.io.read_point_cloud(file)
points = np.asarray(pcd.points)
colors = np.asarray(pcd.colors)
# las = laspy.create(point_format=6, file_version="1.4")
las = laspy.create(point_format=3, file_version="1.2")
las.x = points[:, 0]
las.y = points[:, 1]
las.z = points[:, 2]
las.red = colors[:, 0] * 255
las.green = colors[:, 1] * 255
las.blue = colors[:, 2] * 255
las.write(save_path)