python编程
关注点分离--结构化--有序组织
抽象-封装-复用-解耦
容错-自动化-协议
编程技术概念
索引--遍历-迭代-递归
中断-回滚-模板替换
管道-并发-批量-异步-回调
等效
数据编程中等效--删除不要的 del filter search==提取需要的
old_list,其中有一个索引pos列表,您想删除它:
new_list = [old_list[i] for i, e in enumerate(old_list) if i not in pos]
box计算角点
对于3d标注框,首先在原点按照对象尺寸构建坐标点,然后利用ry旋转角度对目标进行旋转随后再平移到标注尺寸中。
根据中心点位置(x,y,z)/框尺寸h,w,l/朝向角 --》计算框体的8个角点 velo_box: (n,8,3)
中心点位置的定义: kitti标签里的中心点位置在物体下表面
二维矩形框坐标不同的dinginess
激光雷达坐标系中,z方向是高度方向,x方向是汽车前进方向,前进左手边方向为y方向(车身方向)
3D物体的中心点位置
01.8个角点分别沿x,y,z到中心点的距离(8个角点到原点的坐标)原点和xyz的朝向有关
02.旋转矩阵
03.平移到标注尺寸中
示例
# qs: (8,3) array of vertices for the 3d box in following order:
# 1 -------- 0
# /| /|
# 2 -------- 3 .
# | | | |
# . 5 -------- 4
# |/ |/
# 6 -------- 7
x_corners = [l / 2, l / 2, -l / 2, -l / 2, l / 2, l / 2, -l / 2, -l / 2]
y_corners = [0, 0, 0, 0, -h, -h, -h, -h]
z_corners = [w / 2, -w / 2, -w / 2, w / 2, w / 2, -w / 2, -w / 2, w / 2]
##location (x,y,z) in camera coord
corners_3d[0, :] = corners_3d[0, :] + obj.t[0]
corners_3d[1, :] = corners_3d[1, :] + obj.t[1]
corners_3d[2, :] = corners_3d[2, :] + obj.t[2]
2d box计算角点
velo_box: (n,8,3) --》(n,4)
投影前的3D BBox共计有8个点,投影到图像坐标中也会有8个点,
选取八个点中最大值最小值组成 (x1,y1,x2,y2)就是最终的2D BBox
参考
KITTI数据集 激光雷达-图像坐标系转换关系 https://blog.csdn.net/zt1091574181/article/details/114838741
KITTI数据集可视化(二):点云多种视图与标注展示的可视化代码解析 https://blog.csdn.net/weixin_44751294/article/details/128569985
kitti数据集中---标注数据label_2 https://blog.csdn.net/suibianshen2012/article/details/130055526
3D框corner计算 https://zhuanlan.zhihu.com/p/151777998