easyidp.pointcloud.write_laz#
- easyidp.pointcloud.write_laz(laz_path, points, colors, normals=None, offset=array([0., 0., 0.]), decimal=5)#
Save point cloud to laz format
- 参数:
laz_path (str) – the output point cloud file.
points (ndarray) – 点云XYZ信息的numpy ndarray (nx3)
colors (ndarray) – 点云RGB信息的numpy ndarray (nx3)
normals (ndarray, optional) – 点云的法向量信息numpy ndarray (nx3),默认为None
offset (3x1 ndarray, optional) – The offset value defined in the laz file header, by default np.array([0., 0., 0.])
decimal (int, optional) – The decimal for the point value precision, by default 5
示例
Prepare data:
>>> import easyidp as idp >>> test_data = idp.data.TestData() >>> write_points = np.asarray([[-1.9083118, -1.7775583, -0.77878 ], ... [-1.9082794, -1.7772741, -0.7802601], ... [-1.907196 , -1.7748289, -0.8017483], ... [-1.7892904, -1.9612598, -0.8468666], ... [-1.7885809, -1.9391041, -0.839632 ], ... [-1.7862186, -1.9365788, -0.8327141]], dtype=np.float64) >>> write_colors = np.asarray([[ 0, 0, 0], ... [ 0, 0, 0], ... [ 0, 0, 0], ... [192, 64, 128], ... [ 92, 88, 83], ... [ 64, 64, 64]], dtype=np.uint8) >>> write_normals = np.asarray([[-0.03287353, 0.36604664, 0.9300157 ], ... [ 0.08860216, 0.07439037, 0.9932853 ], ... [-0.01135951, 0.2693031 , 0.9629885 ], ... [ 0.4548034 , -0.15576138, 0.876865 ], ... [ 0.4550802 , -0.29450312, 0.8403392 ], ... [ 0.32758632, 0.27255052, 0.9046565 ]], dtype=np.float64)
Use this function:
>>> idp.pointcloud.write_laz(r"path/to/point_cloud.laz", write_points, write_colors, write_normals)
备注
小心
The EasyIDP saved the las file with Las version=1.2