绘制矩形框 def draw_bounding_box(pcd, label): corners = get_box_corners(label) lines = [[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]] colors = [[1, 0, 0] for i in range(len(lines))] line_set = o3d.geometry.LineSet(points=o3d.utility.Vector3dVector(corners), lines=o3d.utility.Vector2iVector(lines)) line_set.colors = o3d.utility.Vector3dVector(colors) pcd += line_set return pcd将矩形框的颜色改成black
时间: 2023-06-25 15:07:25 浏览: 146
可以将 colors = [[0, 0, 0] for i in range(len(lines))],将所有的颜色设置为黑色。然后再将 line_set.colors 赋值为 o3d.utility.Vector3dVector(colors)。修改后的代码如下:
```
def draw_bounding_box(pcd, label):
corners = get_box_corners(label)
lines = [[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]]
colors = [[0, 0, 0] for i in range(len(lines))]
line_set = o3d.geometry.LineSet(points=o3d.utility.Vector3dVector(corners), lines=o3d.utility.Vector2iVector(lines))
line_set.colors = o3d.utility.Vector3dVector(colors)
pcd += line_set
return pcd
```
阅读全文