赞
踩
- import open3d as o3d
- import numpy as np
-
-
- def view_show(point1, point2):
- # 关键点绿色
- point1.paint_uniform_color([0, 1, 0])
- # 点云红色
- point2.paint_uniform_color([1, 0, 0])
-
- # 可视化
- vis = o3d.visualization.Visualizer()
- vis.create_window(window_name="ICP", width=1200, height=1200)
-
- # 设置背景颜色
- vis.get_render_option().background_color = [0, 0, 0] # 白色背景
-
- # 添加点云到Visualizer
- vis.add_geometry(point1)
- vis.add_geometry(point2)
-
- # 运行可视化循环
- vis.run()
- vis.destroy_window()
-
-
- if __name__ == "__main__":
- # 读取点云
- scene = o3d.io.read_point_cloud("data/cow01.pcd")
- target = o3d.io.read_point_cloud("data/cow02.pcd")
-
- # 可视化关键点和原点云
- view_show(scene, target)
- trans_init = np.eye(4)
- # 260这是猪的参数
- # reg_p = o3d.pipelines.registration.registration_icp(
- # keypoints_scene, keyp
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。