# 绘制矩形框 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将矩形框的颜色改成黄色
时间: 2023-07-02 11:03:29 浏览: 54
label上画矩形框(圆形等)
可以将colors修改为[[1, 1, 0] for i in range(len(lines))],即将红色和绿色的值都设为1,蓝色的值为0,表示黄色。修改后的代码如下:
```
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, 1, 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
```
阅读全文