3D Bounding Box Estimation Using Deep Learning and Geometry 论文笔记

3D Bounding Box Estimation Using Deep Learning and Geometry

论文链接: https://arxiv.org/abs/1612.00496

一、Problem Statement

2D目标框如何转3D目标框。CenterNet和百度的apollo都参考了这篇文章。

在这里插入图片描述

二、Direction

第一步先通过深度学习回归出一些相对稳定的3D目标的性质,然后结合2D 目标检测的bounding box所提供的一些几何限制给出一个完整的3D bounding box。所以这个网络模型有三个输出:

  1. 2D bounding box
  2. object orientation
  3. 3D object dimensions

最后根据以上三个输出,估计出目标的 pose ( R , T ) ∈ S E ( 3 ) (R, T) \in SE(3) (R,T)SE(3)并没有直接回归pose。因此也提出了选择回归参数和相关目标函数的方法。

三、Method

1、2D → \rightarrow 3D的理论基础

有一个前提就是:3D bounding box 的透视投影(perspective projection)应该紧密地局限在 2D bounding box上,这就要求每一个2D bounding box上的边,都能够被至少一个3D bounding box 上的一个角的投影所接触到。
3D bounding box 用以下方式来表示:

c e n t e r C = [ c x , c y , c z ] T d i m e n s i o n s D = [ d x , d y , d z ] o r i e n t a t i o n R = [ θ , ϕ , α ] \begin{matrix} center \quad C = [c_x, c_y, c_z]^T \\ dimensions \quad D = [d_x, d_y, d_z] \\ orientation \quad R = [\theta, \phi, \alpha] \end{matrix} centerC=[cx,cy,cz]TdimensionsD=[dx,dy,dz]orientationR=[θ,ϕ,α]
值得注意的是,方向是由方位角,仰角,和翻滚角组成。

因此根据相机坐标系 ( R , T ) ∈ S E ( 3 ) (R, T) \in SE(3) (R,T)SE(3) 和 相机内参矩阵 K K K, 得到 目标坐标系下的3D 点 ( X 0 = [ X , Y , Z , 1 ] ) (X_0=[X,Y,Z,1]) (X0=[X,Y,Z,1])到 2D 图像 ( x = [ x , y , 1 ] ) (x=[x,y,1]) (x=[x,y,1])的一个投影关系:

x = K [ R T ] X 0 x = K[R T] X_0 x=K[RT]X0

假设目标坐标系在3D bounding box的中心,且目标尺寸 D 已知。所以 3D bounding box的顶点(vertices) 可以用如下表示:
X 1 = [ d x / 2 , d y / 2 , d z / 2 ] T X 2 = [ − d x / 2 , d y / 2 , d z / 2 ] T . . . X 8 = [ − d x / 2 , − d y / 2 , − d z / 2 ] T \begin{matrix} X_1=[d_x/2, d_y/2, dz/2]^T \\ X_2=[-d_x/2, d_y/2, dz/2]^T \\ ... \\ X_8=[-d_x/2, -d_y/2, -dz/2]^T \end{matrix} X1=[dx/2,dy/2,dz/2]TX2=[dx/2,dy/2,dz/2]T...X8=[dx/2,dy/2,dz/2]T

举个例子:
已知一个3D 点 X 0 = [ d x / 2 , − d y / 2 , d z / 2 ] X_0 = [d_x/2, -d_y/2, dz/2] X0=[dx/2,dy/2,dz/2], 触碰到了 2D bounding box 的一个左边(x_min)。这个点到边的对应的限制会有如下一个等式:
x m i n = ( K [ R T ] [ d x / 2 − d y / 2 d z / 2 1 ] ) x x_{min}=\left(K[RT]\left[\begin{matrix} d_x/2\\ -d_y/2 \\ d_z/2 \\ 1 \end{matrix}\right]\right)_x xmin=K[RT]dx/2dy/2dz/21x
所以以此类推,2D bounding box的边总共可以提供4个约束。但对于9个自由度(3个平移,3个旋转,3个尺寸)来说是不够的。

(1)、选择回归尺寸 D 而不是回归平移 T
作者也解释了为什么不直接回归平移变量T,而选择回归尺寸D, 是因为:尺寸估计的变化差异通常是很小的,且不会随着目标方向的变化而变化,如果我们同时回归orientation R, 那么选择回归尺寸D是一个比较稳定的预测。其次,尺寸的估计与一些特别的种类有很大的关系,因此如果可以识别出种类,会提高尺寸估计的精度。

(2)、那怎么得到平移矩阵T呢?
由公式
x = K [ R T ] X 0 x = K[R T] X_0 x=K[RT]X0
我们知道了K, 预测出来了R, 再加上2D bounding box,就可以得到 平移矩阵 T 了。

2D bounding box 的每一条边可以对应3D bounding box的8个任意一个角点,因此会有 8 4 = 4096 8^4=4096 84=4096个选择。在大多数的场景,目标总是会被认为是向上的,因此 2D bounding box 上 和 下的边仅仅分别对应3D bounding box的上 和 下的角点,这就可以使得选择缩减为1024个。再者, roll(翻滚角)通常接近0,所以对应的2D bounding box 垂直边 x m i n , x m a x x_{min}, x_{max} xmin,xmax只对应垂直的3D 边。所以就把选择再次缩减到 4 4 = 256 4^4=256 44=256。在KITTI数据集上, pitch 和 roll 角度都为0. 所以最后缩减为 64。

2、怎么样回归出 orientation 和 dimensions

作者回归的是局部方向 θ l \theta_l θl,因为global orientation不会改变,figure 4就可以说明。所以最后的汽车角度为:
θ = θ r a y + θ l \theta = \theta_{ray} + \theta_l θ=θray+θl
θ r a y \theta_{ray} θray 可以通过相机的内参矩阵计算得到。

再来看以下网络的整体结构:

也就是在预测2D bounding box上多加一个三个分支。两个分支用于预测 orientation 一个 分支用于预测 dimensions。

再来看一下相对应的 loss function:
L = α L d i m s + L θ L=\alpha L_{dims} + L_{\theta} L=αLdims+Lθ

(1)、目标尺寸损失函数 L d i m s L_{dims} Ldims
在Kitti数据集中,cars、vans、trucks和buses属于不同的类别且对象尺寸的分布是低方差(low-variance)和单峰(unimodal)的。例如,汽车和自行车的尺寸变化是几厘米。因此直接使用L2 Loss。作为标准,对于每个尺寸,我们估计相对于训练数据集上计算的平均参数值的残差
L d i m s = 1 n ∑ ( D ∗ − D ˉ − δ ) 2 L_{dims}=\frac{1}{n}\sum({D^*-\bar{D} - \delta})^2 Ldims=n1(DDˉδ)2

D ∗ D^* D是 尺寸的 ground truth, D ˉ \bar{D} Dˉ 是某一种类的均值尺寸, δ \delta δ 是估计出来的相对于均值的残差。

(2)、目标方向损失函数 L θ L_{\theta} Lθ

L θ = L c o n f + w ∗ L l o c L_{\theta}=L_{conf}+w*L_{loc} Lθ=Lconf+wLloc

首先作者对于orientation的预测是采用了MultiBin的结构。步骤为:

  1. 先把方向角离散化,平均分成n个重叠的区间。
  2. 然后对每一个区间,预测confidence probability 和 residual rotation correction。confidence probability 是输出角度落在 i t h i^{th} ith区间的置信度。residual rotation correction 是用于那个区间的中心线射线的方向,是为了获得输出角度的。residual rotation 用两个数字来表示: sine, cosine

所以每个bin有三个输出: ( c i , c o s ( △ θ i ) , s i n ( △ θ i ) ) (c_i, cos(\triangle\theta_i), sin(\triangle\theta_i)) (ci,cos(θi),sin(θi))

L c o n f L_{conf} Lconf 是每一个区间置信度的softmax。 L l o c L_{loc} Lloc试图最小化估计每个区间中的估计角度和真实角度之间的差距,其中相邻的区间具有重叠部分。
L l o c = − 1 n θ ∗ ∑ c o s ( θ ∗ − c i − △ θ i ) L_{loc} = -\frac{1}{n_{\theta^*}}\sum cos(\theta^*-c_i-\triangle\theta_i) Lloc=nθ1cos(θciθi)
n θ ∗ n_{\theta^*} nθ是区间覆盖真值 θ ∗ \theta^* θ的数量, c i c_i ci是区间 i 中心的角度, △ θ i \triangle\theta_i θi是用于区间 i 的中心的矫正值。

四、Conclusion

比较好的一篇文章。不引入额外的label进行预测3D bounding box。结构也简单明了。可是在实际中应用中,光有图像的3D bounding box意义不大,需要换算到实际的地图上。因此这个方法个人觉得需要结合深度估计和pseudo-lidar技术,进行应用。

References

  1. https://zhuanlan.zhihu.com/p/64617445
  2. https://blog.csdn.net/qq_29462849/article/details/91314777
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值