本文主要是介绍open3d 点云外接bbox,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
点云外接bbox分两种:与坐标轴对齐的bbox,带方向旋转的bbox.
import open3d as o3dif __name__ == "__main__":# 1. read pcdsample_ply_data = o3d.data.PLYPointCloud()pcd = o3d.io.read_point_cloud(sample_ply_data.path)# Flip it, otherwise the pointcloud will be upside down.pcd.transform([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]])print(pcd)# 2. AxisAlignedBoundingBox: 与坐标轴对其的bboxaxis_aligned_bounding_box = pcd.get_axis_aligned_bounding_box()axis_aligned_bounding_box.color = (1, 0, 0)# 3. OrientedBoundingBox: 与带方向的旋转bboxoriented_bounding_box = pcd.get_oriented_bounding_box()oriented_bounding_box.color = (0, 1, 0)# 4. viewprint("Displaying axis_aligned_bounding_box in red and oriented bounding box in green ...")corr = o3d.geometry.TriangleMesh.create_coordinate_frame(size=0.5)o3d.visualization.draw([pcd, corr, axis_aligned_bounding_box, oriented_bounding_box])
这篇关于open3d 点云外接bbox的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!