Open3D
用一个个小体素去占据点云
conda activete deeplabv3plus(环境名称–安装好open3D的)
python demo.py
import open3d as o3d
import numpy as np
def draw_geometries(result, batch=False):
if not batch:
for i in range(len(result)):
o3d.visualization.draw_geometries([result[i]], "result", 800, 600, 50, 50, False, False, True)
else:
o3d.visualization.draw_geometries(result, "result", 800, 600, 50, 50, False, True, True)
def main():
result = []
# 读取数据
pcd = o3d.io.read_point_cloud("downsampled_pcd.pcd") # 替换为您的 .pcd 文件路径
# ------------------------------点云体素化处理-------------------------------
voxel_grid = o3d.geometry.VoxelGrid.create_from_point_cloud(pcd, voxel_size=0.05)
result.append(pcd)
result.append(voxel_grid)
draw_geometries(result, True)
if __name__ == "__main__":
main()