VIO第3讲:基于优化的IMU与视觉信息融合之视觉残差雅可比推导

VIO第3讲:基于优化的IMU与视觉信息融合之视觉残差函数构建

文章目录

  • VIO第3讲:基于优化的IMU与视觉信息融合之视觉残差函数构建
  • 3 视觉重投影残差的 Jacobian
    • 3.1 视觉重投影残差
      • ① 估计值(预测值)
        • <1> 推导
        • <2> 引出因子图-优化变量
        • <3> 简化形式
      • ② 观测值
    • 3.2 重投影残差雅可比J
      • ① 残差对归一化坐标点 f c j {\mathbf{f}_{c_j}} fcj导数
      • ② 归一化坐标点 f c j {\mathbf{f}_{c_j}} fcj对扰动量求导
        • <1> 对i时刻状态量求导
        • <2> 对j时刻状态量求导
        • <3> 对 imu 和相机之间的外参求导
        • <4> 对特征逆深度的求导

3 视觉重投影残差的 Jacobian

3.1 视觉重投影残差

  • 特征点在归一化相机坐标系与在相机坐标系下的坐标关系为

[ x y z ] = 1 λ [ u v 1 ] \begin{bmatrix}x\\y\\z\end{bmatrix}=\dfrac{1}{\lambda}\begin{bmatrix}u\\v\\1\end{bmatrix} xyz =λ1 uv1

  其中 λ = 1 / z \lambda=1/z λ=1/z称之为逆深度!,记住这个形式,后续在求解雅可比的链式法则中,往往第一步就是利用这里的形式!

  归一化使得数值变小,数值稳定性更好。

  • 视觉重投影残差—注意是归一化坐标之差(估计-观测),而不是像素系坐标之差

r c = [ x c j z c j − u c j y c j z c j − v c j ] \mathbf{r}_c=\begin{bmatrix}\frac{x_{c_j}}{z_{c_j}}-u_{c_j}\\\frac{y_{c_j}}{z_{c_j}}-v_{c_j}\end{bmatrix} rc= zcjxcjucjzcjycjvcj

① 估计值(预测值)

  对于估计:同一个路标点P,第 i 帧(第一次看到)中的特征点,它投影到第 j 帧相机坐标系下的归一化值
[ x c j y c j z c j 1 ] = T b c − 1 T w b j − 1 T w b i T b c [ 1 λ u c i 1 λ v c i 1 λ 1 ] \begin{bmatrix}x_{c_j}\\y_{c_j}\\z_{c_j}\\1\end{bmatrix}=\mathbf{T}_{bc}^{-1}\mathbf{T}_{wb_j}^{-1}\mathbf{T}_{wb_i}\mathbf{T}_{bc}\begin{bmatrix}\frac1\lambda u_{c_i}\\\frac1\lambda v_{c_i}\\\frac1\lambda\\1\end{bmatrix} xcjycjzcj1 =Tbc1Twbj1TwbiTbc λ1uciλ1vciλ11

<1> 推导

  对于这一过程详细的推导,下面 π c − 1 \pi_{c}^{-1} πc1表示把一个像素坐标反投影到相机坐标系,即归一化坐标。反正知道这样表示归一化坐标即可,和上面是一致的。l表示第l个路标点, R c b R_{c}^{b} Rcb表示外参,IMU坐标系到cam坐标系的转换。下面对应论文vins-mono。主要就是分别写旋转矩阵平移量

   P 在第 i 个相机归一化坐标系下坐标为:
P u v i = λ l π c ( T b ← c − 1 T w ← b i − 1 P w l ) ⟺ P w l = T w ← b i T b ← c 1 λ l π c − 1 ( P u v i ) P w l = R b l w ( R c b 1 λ l π c − 1 ( [ u l c i v l c l ] ) + p c b ) + p b l w \begin{aligned} &P_{uv_{i}}=\lambda_{l}\pi_{c}\bigl(T_{b\leftarrow c}{}^{-1}T_{w\leftarrow b_{i}}{}^{-1}P_{w_{l}}\bigr) \\ &\Longleftrightarrow P_{w_{l}}=T_{w\leftarrow b_{i}}T_{b\leftarrow c}\frac{1}{\lambda_{l}}\pi_{c}{}^{-1}\big(P_{uv_{i}}\big) \\ &\left.\left.P_{w_{l}}=R_{b_{l}}^{w}\left(R_{c}^{b}\frac{1}{\lambda_{l}}\pi_{c}^{-1}\left(\begin{bmatrix}u_{l}^{c_{i}}\\v_{l}^{c_{l}}\end{bmatrix}\right.\right.\right)+p_{c}^{b}\right)+p_{b_{l}}^{w} \end{aligned} Puvi=λlπc(Tbc1Twbi1Pwl)Pwl=TwbiTbcλl1πc1(Puvi)Pwl=Rblw(Rcbλl1πc1([ulcivlcl])+pcb)+pblw
  P 在第 j 个相机的相机坐标系下坐标为
P l c j = T b ← c − 1 T w ← b j − 1 P w l ⟺ P w l = T w ← b j T b ← c P l c j \begin{gathered} P_{l}^{c_{j}}=T_{b\leftarrow c}{}^{-1}T_{w\leftarrow b_{j}}{}^{-1}P_{w_{l}} \\ \Longleftrightarrow P_{w_{l}}=T_{w\leftarrow b_{j}}T_{b\leftarrow c}P_{l}^{c_{j}} \end{gathered} Plcj=Tbc1Twbj1PwlPwl=TwbjTbcPlcj
  代入到上面式子,就可以得到第l个路标点在第j个相机归一化坐标系下的可能坐标,本质上也对应第一个 T b c − 1 T w b j − 1 T w b i T b c \mathbf{T}_{bc}^{-1}\mathbf{T}_{wb_j}^{-1}\mathbf{T}_{wb_i}\mathbf{T}_{bc} Tbc1Twbj1TwbiTbc变换,写开是为了后面更好求解优化变量的雅可比!
R b i w ( R c b 1 λ l π c − 1 ( [ u l c i v l c i ] ) + p c b ) + p b i w = R b j w ( R c b P l c j + p c b ) + p b j w ⇒ P l c j = R b c { R w b j [ R b i w ( R c b 1 λ l π c − 1 ( [ u l c l v l c i ] ) + p c b ) + p b i w − p b j w ] − p c b } = R b c { R w b j [ R b i w ( R c b 1 λ l P ˉ l c i + p c b ) + p b i w − p b j w ] − p c b } \begin{gathered} \left.\left.R_{b_{i}}^{w}\left(R_{c}^{b}\frac{1}{\lambda_{l}}\pi_{c}^{-1}\left(\begin{bmatrix}u_{l}^{c_{i}}\\v_{l}^{c_{i}}\end{bmatrix}\right.\right.\right)+p_{c}^{b}\right)+p_{b_{i}}^{w}=R_{b_{j}}^{w}\left(R_{c}^{b}P_{l}^{c_{j}}+p_{c}^{b}\right)+p_{b_{j}}^{w} \\ \left.\left.\left.\left.\Rightarrow P_{l}^{c_{j}}=R_{b}^{c}\left\{R_{w}^{b_{j}}\left[R_{b_{i}}^{w}\left(R_{c}^{b}\frac{1}{\lambda_{l}}\pi_{c}^{-1}\left(\begin{bmatrix}u_{l}^{c_{l}}\\v_{l}^{c_{i}}\end{bmatrix}\right.\right.\right.\right.\right)+p_{c}^{b}\right)+p_{b_{i}}^{w}-p_{b_{j}}^{w}\right]-p_{c}^{b}\right\} \\ =R_{b}^{c}\left\{R_{w}^{b_{j}}\left[R_{b_{i}}^{w}\left(R_{c}^{b}\frac{1}{\lambda_{l}}\bar{P}_{l}^{c_{i}}+p_{c}^{b}\right)+p_{b_{i}}^{w}-p_{b_{j}}^{w}\right]-p_{c}^{b}\right\} \end{gathered} Rbiw(Rcbλl1πc1([ulcivlci])+pcb)+pbiw=Rbjw(RcbPlcj+pcb)+pbjwPlcj=Rbc{Rwbj[Rbiw(Rcbλl1πc1([ulclvlci])+pcb)+pbiwpbjw]pcb}=Rbc{Rwbj[Rbiw(Rcbλl1Pˉlci+pcb)+pbiwpbjw]pcb}

<2> 引出因子图-优化变量

  涉及第i帧、第j帧、外参、以及逆深度
[ p b i w , q b i w ] , [ p b j w , q b j w ] , [ p c b , q c b ] , λ l ∘ [p_{b_i}^w,q_{b_i}^w],\begin{bmatrix}p_{b_j}^w,q_{b_j}^w\end{bmatrix},[p_c^b,q_c^b],\lambda_{l^\circ} [pbiw,qbiw],[pbjw,qbjw],[pcb,qcb],λl
  为什么雅可比是下面这样的?因为虽然我们说是对状态量求导,实际上是对扰动求导!这个李代数扰动求导应该非常常见了。所以下面式子的角标就代表了扰动量
J = [ ∂ r c ∂ [ δ p b i b i ′ δ θ b i b i ′ ] ∂ r c ∂ [ δ p b j b j ′ δ θ b j b j ′ ] ∂ r c ∂ [ δ p c c ′ δ θ c c ′ ] ∂ r c ∂ δ λ ] \mathbf{J}=\begin{bmatrix}\dfrac{\partial\mathbf{r}_c}{\partial\begin{bmatrix}\delta\mathbf{p}_{b_ib_i^{\prime}}\\\delta\boldsymbol{\theta}_{b_ib_i^{\prime}}\end{bmatrix}}&\dfrac{\partial\mathbf{r}_c}{\partial\begin{bmatrix}\delta\mathbf{p}_{b_jb_j^{\prime}}\\\delta\boldsymbol{\theta}_{b_jb_j^{\prime}}\end{bmatrix}}&\dfrac{\partial\mathbf{r}_c}{\partial\begin{bmatrix}\delta\mathbf{p}_{cc^{\prime}}\\\delta\boldsymbol{\theta}_{cc^{\prime}}\end{bmatrix}}& \frac{\partial\mathbf{r}_c}{\partial\delta\lambda}&\end{bmatrix} J= [δpbibiδθbibi]rc[δpbjbjδθbjbj]rc[δpccδθcc]rcδλrc

<3> 简化形式

  把上面推导得到第l个路标点在第j个相机归一化坐标系下的可能坐标乘出来,就可以得到下面式子:
f c j = [ x c j y c j z c j ] = R b c ⊤ R w b j ⊤ R w b i R b c 1 λ [ u c i v c i 1 ] + R b c ⊤ ( R w b j ⊤ ( ( R w b i p b c + p w b i ) − p w b j ) − p b c ) \begin{aligned} \mathbf{f}_{c_j}=\begin{bmatrix}x_{c_j}\\y_{c_j}\\z_{c_j}\end{bmatrix}& =\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}\frac1\lambda\begin{bmatrix}u_{c_i}\\v_{c_i}\\1\end{bmatrix} \\ &+\mathbf{R}_{bc}^\top(\mathbf{R}_{wb_j}^\top((\mathbf{R}_{wb_i}\mathbf{p}_{bc}+\mathbf{p}_{wb_i})-\mathbf{p}_{wb_j})-\mathbf{p}_{bc}) \end{aligned} fcj= xcjycjzcj =RbcRwbjRwbiRbcλ1 ucivci1 +Rbc(Rwbj((Rwbipbc+pwbi)pwbj)pbc)
其中 f c i = [ x c i y c i z c i ] \mathbf{f}_{c_i}=\begin{bmatrix}x_{c_i}\\y_{c_i}\\z_{c_i}\end{bmatrix} fci= xciycizci ,然后,分别定义如下变量:
f b i = R b c f c i + p b c f w = R w b i f b i + p w b i f b j = R w b j ⊤ ( f w − p b c ) \begin{aligned}\mathbf{f}_{b_i}&=\mathbf{R}_{bc}\mathbf{f}_{c_i}+\mathbf{p}_{bc}\\\mathbf{f}_w&=\mathbf{R}_{wb_i}\mathbf{f}_{b_i}+\mathbf{p}_{wb_i}\\\mathbf{f}_{b_j}&=\mathbf{R}_{wb_j}^\top(\mathbf{f}_w-\mathbf{p}_{bc})\end{aligned} fbifwfbj=Rbcfci+pbc=Rwbifbi+pwbi=Rwbj(fwpbc)

② 观测值

  这个后面在补充下吧,纯视觉里面比如讲特征匹配结果作为了观测值;在MSCKF中将视觉的观测作为观测值。观测应该就是路标点P在第j帧的投影

3.2 重投影残差雅可比J

① 残差对归一化坐标点 f c j {\mathbf{f}_{c_j}} fcj导数

  这在视觉里面应该是很常见的基本操作了
∂ r c ∂ f c j = [ 1 z c j 0 − x c j z c j 2 0 1 z c j − y c j 2 z c j 2 ] \frac{\partial\mathbf{r}_c}{\partial\mathbf{f}_{c_j}}=\begin{bmatrix}\frac{1}{z_{c_j}}&0&-\frac{x_{c_j}}{z_{c_j}^2}\\0&\frac{1}{z_{c_j}}&-\frac{y_{c_j}^2}{z_{c_j}^2}\end{bmatrix} fcjrc= zcj100zcj1zcj2xcjzcj2ycj2

② 归一化坐标点 f c j {\mathbf{f}_{c_j}} fcj对扰动量求导

<1> 对i时刻状态量求导

对 i 时刻位移- p w b i p_{wb_{i}} pwbi

∂ f c j ∂ δ p b i b i ′ = R b c ⊤ R w b j ⊤ \frac{\partial\mathbf{f}_{c_j}}{\partial\delta\mathbf{p}_{b_ib_i^{\prime}}}=\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top δpbibifcj=RbcRwbj

对 i 时刻角度增量—旋转

f c j = R b c ⊤ R w b j ⊤ R w b i R b c f c i + R b c ⊤ ( R w b j ⊤ ( ( R w b i p b c + p w b i ) − p w b j ) − p b c ) \mathrm{f}_{c_j}=\mathrm{R}_{bc}^\top\mathrm{R}_{wb_j}^\top\mathrm{\color{red}{R}_{wb_i}}\mathrm{R}_{bc}\mathrm{f}_{c_i}+\mathrm{R}_{bc}^\top(\mathrm{R}_{wb_j}^\top(({\color{red}{R}_{wb_i}}\mathrm{p}_{bc}+\mathrm{p}_{wb_i})-\mathrm{p}_{wb_j})-\mathrm{p}_{bc}) fcj=RbcRwbjRwbiRbcfci+Rbc(Rwbj((Rwbipbc+pwbi)pwbj)pbc)

  简化,丢弃不相关量
f c j = R b c ⊤ R w b j ⊤ R w b i R b c f c i + R b c ⊤ R w b j ⊤ R w b i p b c + ( . . . ) = R b c ⊤ R w b j ⊤ R w b i ( R b c f c i + p b c ) + ( . . . ) = R b c ∣ R w b j ∣ R w b i f b i + ( . . . ) \begin{aligned} \mathbf{f}_{c_j}& =\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}\mathbf{f}_{c_i}+\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{p}_{bc}+(...) \\ &=\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}(\mathbf{R}_{bc}\mathbf{f}_{c_i}+\mathbf{p}_{bc})+(...) \\ &=\mathbf{R}_{bc}^{|}\mathbf{R}_{wb_j}^{|}\mathbf{R}_{wb_i}\mathbf{f}_{b_i}+(...) \end{aligned} fcj=RbcRwbjRwbiRbcfci+RbcRwbjRwbipbc+(...)=RbcRwbjRwbi(Rbcfci+pbc)+(...)=RbcRwbjRwbifbi+(...)
  注意这里是全局坐标系,右扰动。这里分子简化了,这种求扰动是非常熟悉的泰勒展开约去,然后叉积交换等等
∂ f c j ∂ δ θ b i b i ′ = ∂ R b c ⊤ R w b j ⊤ R w b i ( I + [ δ θ b i b i ′ ] × ) f b i ∂ δ θ b i b i ′ = − R b c ⊤ R w b j ⊤ R w b i [ f b i ] × \begin{aligned} \frac{\partial\mathbf{f}_{c_j}}{\partial\delta\boldsymbol{\theta}_{b_ib_i^{\prime}}}& \begin{aligned}=\frac{\partial\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}(\mathbf{I}+[\delta\boldsymbol{\theta}_{b_ib_i^\prime}]_\times)\mathbf{f}_{b_i}}{\partial\delta\boldsymbol{\theta}_{b_ib_i^\prime}}\end{aligned} \\ &=-\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}[\mathbf{f}_{b_i}]_\times \end{aligned} δθbibifcj=δθbibiRbcRwbjRwbi(I+[δθbibi]×)fbi=RbcRwbjRwbi[fbi]×

<2> 对j时刻状态量求导

对 j 时刻位移

∂ f c j ∂ δ p b j b j ′ = − R b c ⊤ R w b j ⊤ \frac{\partial\mathbf{f}_{c_j}}{\partial\delta\mathbf{p}_{b_j}b_j^{\prime}}=-\mathbf{R}_{bc}^{\top}\mathbf{R}_{wb_j}^{\top} δpbjbjfcj=RbcRwbj

对 j 时刻角度增量—旋转

  简化,丢弃不相关量
f c j = R b c ⊤ R w b j ⊤ R w b i R b c f c i + R b c ⊤ ( R w b j ⊤ ( ( R w b i p b c + p w b i ) − p w b j ) − p b c ) = R b c ⊤ R w b j ⊤ ( R w b i ( R b c f c i + p b c ) + p w b i − p w b j ) + ( . . . ) = R b c ⊤ R w b j ⊤ ( f w − p w b j ) + ( . . . ) \begin{aligned} \mathbf{f}_{c_j}& =\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}\mathbf{f}_{c_i}+\mathbf{R}_{bc}^\top(\mathbf{R}_{wb_j}^\top((\mathbf{R}_{wb_i}\mathbf{p}_{bc}+\mathbf{p}_{wb_i})-\mathbf{p}_{wb_j})-\mathbf{p}_{bc}) \\ &=\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top(\mathbf{R}_{wb_i}(\mathbf{R}_{bc}\mathbf{f}_{c_i}+\mathbf{p}_{bc})+\mathbf{p}_{wb_i}-\mathbf{p}_{wb_j})+(...) \\ &=\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top(\mathbf{f}_w-\mathbf{p}_{wb_j})+(...) \end{aligned} fcj=RbcRwbjRwbiRbcfci+Rbc(Rwbj((Rwbipbc+pwbi)pwbj)pbc)=RbcRwbj(Rwbi(Rbcfci+pbc)+pwbipwbj)+(...)=RbcRwbj(fwpwbj)+(...)
  注意这里是局部坐标系,左扰动。还有,注意这里是负扰动。为什么是负的?因为扰动量是bb‘,但分子是局部坐标系,是bw,所以要加上个负号,表示反方向的旋转!
∂ f c j ∂ δ θ b j b j ′ = ∂ R b c ⊤ ( I − [ δ θ b j b j ′ ] × ) R w b j ⊤ ( f w − p w b j ) ∂ δ θ b j b j ′ a l i g n e d = ∂ R b c ⊤ ( I − [ δ θ b j b j ′ ] × ) f b j ∂ δ θ b j b j ′ = R b c ⊤ [ f b j ] × 州一个州一位 Din Di \begin{aligned} \frac{\partial\mathbf{f}_{c_j}}{\partial\delta\boldsymbol{\theta}_{b_jb_j^{\prime}}}& \begin{aligned}=\frac{\partial\mathbf{R}_{bc}^{\top}(\mathbf{I}-[\delta\boldsymbol{\theta}_{b_jb_j^{\prime}}]_{\times})\mathbf{R}_{wb_j}^{\top}(\mathbf{f}_w-\mathbf{p}_{wb_j})}{\partial\delta\boldsymbol{\theta}_{b_jb_j^{\prime}} {aligned}}\end{aligned} \\ &=\frac{\partial\mathbf{R}_{bc}^\top(\mathbf{I}-[\delta\boldsymbol{\theta}_{b_jb_j^\prime}]_\times)\mathbf{f}_{b_j}}{\partial\delta\boldsymbol{\theta}_{b_jb_j^\prime}} \\ &=\mathbf{R}_{bc}^\top[\mathbf{f}_{b_j}]_\times & \text{州一个州一位 Din Di} \end{aligned} δθbjbjfcj=δθbjbjalignedRbc(I[δθbjbj]×)Rwbj(fwpwbj)=δθbjbjRbc(I[δθbjbj]×)fbj=Rbc[fbj]×州一个州一位 Din Di

<3> 对 imu 和相机之间的外参求导

对位移 p b c p_{bc} pbc求导,扰动量 c c ′ cc^{'} cc

∂ f c j ∂ δ p c c ′ = R b c ⊤ ( R w b j ⊤ R w b i − I 3 × 3 ) \frac{\partial\mathbf{f}_{c_j}}{\partial\delta\mathbf{p}_{cc^{\prime}}}=\mathbf{R}_{bc}^\top(\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}-\mathbf{I}_{3\times3}) δpccfcj=Rbc(RwbjRwbiI3×3)

对角度增量求导,由于 f c j f_{c_j} fcj 都和 R b c R_{bc} Rbc有关,并且比较复杂,所以这
次分两部分求导

f c j = R b c ⊤ R w b j ⊤ R w b i R b c f c i + R b c ⊤ ( R w b j ⊤ ( ( R w b i p b c + p w b i ) − p w b j ) − p b c ) = f c j 1 + f c j 2 \begin{aligned}\mathbf{f}_{c_j}&=\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}\mathbf{f}_{c_i}+\mathbf{R}_{bc}^\top(\mathbf{R}_{wb_j}^\top((\mathbf{R}_{wb_i}\mathbf{p}_{bc}+\mathbf{p}_{wb_i})-\mathbf{p}_{wb_j})-\mathbf{p}_{bc})\\&=\mathbf{f}_{c_j}^1+\mathbf{f}_{c_j}^2\end{aligned} fcj=RbcRwbjRwbiRbcfci+Rbc(Rwbj((Rwbipbc+pwbi)pwbj)pbc)=fcj1+fcj2

第一部分
∂ f c j 1 ∂ δ θ c c ′ = ∂ ( I − [ δ θ c c ′ ] × ) R b c ⊤ R w b j ⊤ R w b i R b c ( I + [ δ θ c c ′ ] × ) f c i ∂ δ θ c c ′ \frac{\partial\mathbf{f}_{c_j}^1}{\partial\delta\boldsymbol{\theta}_{cc^{\prime}}}=\frac{\partial(\mathbf{I}-[\delta\boldsymbol{\theta}_{cc^{\prime}}]_\times)\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}(\mathbf{I}+[\delta\boldsymbol{\theta}_{cc^{\prime}}]_\times)\mathbf{f}_{c_i}}{\partial\delta\boldsymbol{\theta}_{cc^{\prime}}} δθccfcj1=δθcc(I[δθcc]×)RbcRwbjRwbiRbc(I+[δθcc]×)fci
分子可以写成
∂ R b c ⊤ R w b j ⊤ R w b i R b c [ δ θ c c ′ ] × f c i − [ δ θ c c ′ ] × R b c ⊤ R w b j ⊤ R w b i R b c f c i + o 2 ( δ θ c c ′ ) + ( . . . ) \begin{aligned}&\partial\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}[\delta\boldsymbol{\theta}_{cc^\prime}]_\times\mathbf{f}_{c_i}-[\delta\boldsymbol{\theta}_{cc^\prime}]_\times\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}\mathbf{f}_{c_i}\\&+o^2(\delta\boldsymbol{\theta}_{cc^\prime})+(...)\end{aligned} RbcRwbjRwbiRbc[δθcc]×fci[δθcc]×RbcRwbjRwbiRbcfci+o2(δθcc)+(...)

∂ f c j 1 ∂ δ θ c c ′ = − R b c ⊤ R w b j ⊤ R w b i R b c [ f c i ] × + [ R b c ⊤ R w b j ⊤ R w b i R b c f c i ] × \frac{\partial\mathbf{f}_{c_j}^1}{\partial\delta\boldsymbol{\theta}_{cc^{\prime}}}=-\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}[\mathbf{f}_{c_i}]_\times+[\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}\mathbf{f}_{c_i}]_\times δθccfcj1=RbcRwbjRwbiRbc[fci]×+[RbcRwbjRwbiRbcfci]×

第二部分
∂ f c j 2 ∂ δ θ c c ′ = ( I − [ δ θ c c ′ ] × ) R b c † ( R w b j † ( ( R w b i p b c + p w b i ) − p w b j ) − p b c ) ∂ δ θ c c ′ = [ R b c ⊤ ( R w b j ⊤ ( ( R w b i p b c + p w b i ) − p w b j ) − p b c ) ] × \begin{gathered} \frac{\partial\mathbf{f}_{c_j}^2}{\partial\delta\boldsymbol{\theta}_{cc^{\prime}}} =\frac{(\mathbf{I}-[\delta\boldsymbol{\theta}_{cc^{\prime}}]_{\times})\mathbf{R}_{bc}^{\dagger}(\mathbf{R}_{wb_{j}}^{\dagger}((\mathbf{R}_{wb_{i}}\mathbf{p}_{bc}+\mathbf{p}_{wb_{i}})-\mathbf{p}_{wb_{j}})-\mathbf{p}_{bc})}{\partial\delta\boldsymbol{\theta}_{cc^{\prime}}} \\ =[\mathbf{R}_{bc}^\top(\mathbf{R}_{wb_j}^\top((\mathbf{R}_{wb_i}\mathbf{p}_{bc}+\mathbf{p}_{wb_i})-\mathbf{p}_{wb_j})-\mathbf{p}_{bc})]_\times \end{gathered} δθccfcj2=δθcc(I[δθcc]×)Rbc(Rwbj((Rwbipbc+pwbi)pwbj)pbc)=[Rbc(Rwbj((Rwbipbc+pwbi)pwbj)pbc)]×

两部分加起来就是视觉误差对外参的角度增量的最终结果

<4> 对特征逆深度的求导

∂ f c j ∂ δ λ = ∂ f c j ∂ f c i ∂ f c i ∂ δ λ = R b c ⊤ R w b j ⊤ R w b i R b c ( − 1 λ 2 [ u c i v c i 1 ] ) = − 1 λ R b c ⊤ R w b j ⊤ R w b i R b c f c i \begin{aligned} \frac{\partial\mathbf{f}_{c_j}}{\partial\delta\lambda}& =\frac{\partial\mathbf{f}_{c_{j}}}{\partial\mathbf{f}_{c_{i}}}\frac{\partial\mathbf{f}_{c_{i}}}{\partial\delta\lambda} \\ &=\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}(-\frac{1}{\lambda^2}\begin{bmatrix}u_{c_i}\\v_{c_i}\\1\end{bmatrix}) \\ &=-\frac1\lambda\mathbf{R}_{bc}^\top\mathbf{R}_{wb_j}^\top\mathbf{R}_{wb_i}\mathbf{R}_{bc}\mathbf{f}_{c_i} \end{aligned} δλfcj=fcifcjδλfci=RbcRwbjRwbiRbc(λ21 ucivci1 )=λ1RbcRwbjRwbiRbcfci

你可能感兴趣的:(从零开始手写,VIO,视觉重投影残差与雅可比推导,从0手写vio)