[ 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= zcjxcj−ucjzcjycj−vcj
对于估计:同一个路标点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 =Tbc−1Twbj−1TwbiTbc λ1uciλ1vciλ11
对于这一过程详细的推导,下面 π c − 1 \pi_{c}^{-1} πc−1表示把一个像素坐标反投影到相机坐标系,即归一化坐标。反正知道这样表示归一化坐标即可,和上面是一致的。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(Tb←c−1Tw←bi−1Pwl)⟺Pwl=Tw←biTb←cλl1πc−1(Puvi)Pwl=Rblw(Rcbλl1πc−1([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=Tb←c−1Tw←bj−1Pwl⟺Pwl=Tw←bjTb←cPlcj
代入到上面式子,就可以得到第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} Tbc−1Twbj−1TwbiTbc变换,写开是为了后面更好求解优化变量的雅可比!
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πc−1([ulcivlci])+pcb)+pbiw=Rbjw(RcbPlcj+pcb)+pbjw⇒Plcj=Rbc{Rwbj[Rbiw(Rcbλl1πc−1([ulclvlci])+pcb)+pbiw−pbjw]−pcb}=Rbc{Rwbj[Rbiw(Rcbλl1Pˉlci+pcb)+pbiw−pbjw]−pcb}
涉及第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
把上面推导得到第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 =Rbc⊤Rwbj⊤RwbiRbcλ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⊤(fw−pbc)
这个后面在补充下吧,纯视觉里面比如讲特征匹配结果作为了观测值;在MSCKF中将视觉的观测作为观测值。观测应该就是路标点P在第j帧的投影
这在视觉里面应该是很常见的基本操作了
∂ 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} ∂fcj∂rc= zcj100zcj1−zcj2xcj−zcj2ycj2
对 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 ∂δpbibi′∂fcj=Rbc⊤Rwbj⊤
对 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=Rbc⊤Rwbj⊤RwbiRbcfci+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=Rbc⊤Rwbj⊤RwbiRbcfci+Rbc⊤Rwbj⊤Rwbipbc+(...)=Rbc⊤Rwbj⊤Rwbi(Rbcfci+pbc)+(...)=Rbc∣Rwbj∣Rwbifbi+(...)
注意这里是全局坐标系,右扰动。这里分子简化了,这种求扰动是非常熟悉的泰勒展开约去,然后叉积交换等等
∂ 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} ∂δθbibi′∂fcj=∂δθbibi′∂Rbc⊤Rwbj⊤Rwbi(I+[δθbibi′]×)fbi=−Rbc⊤Rwbj⊤Rwbi[fbi]×
对 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} ∂δpbjbj′∂fcj=−Rbc⊤Rwbj⊤
对 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=Rbc⊤Rwbj⊤RwbiRbcfci+Rbc⊤(Rwbj⊤((Rwbipbc+pwbi)−pwbj)−pbc)=Rbc⊤Rwbj⊤(Rwbi(Rbcfci+pbc)+pwbi−pwbj)+(...)=Rbc⊤Rwbj⊤(fw−pwbj)+(...)
注意这里是局部坐标系,左扰动。还有,注意这里是负扰动。为什么是负的?因为扰动量是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} ∂δθbjbj′∂fcj=∂δθbjbj′aligned∂Rbc⊤(I−[δθbjbj′]×)Rwbj⊤(fw−pwbj)=∂δθbjbj′∂Rbc⊤(I−[δθbjbj′]×)fbj=Rbc⊤[fbj]×州一个州一位 Din Di
对位移 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}) ∂δpcc′∂fcj=Rbc⊤(Rwbj⊤Rwbi−I3×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=Rbc⊤Rwbj⊤RwbiRbcfci+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}}} ∂δθcc′∂fcj1=∂δθcc′∂(I−[δθcc′]×)Rbc⊤Rwbj⊤RwbiRbc(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} ∂Rbc⊤Rwbj⊤RwbiRbc[δθcc′]×fci−[δθcc′]×Rbc⊤Rwbj⊤RwbiRbcfci+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 ∂δθcc′∂fcj1=−Rbc⊤Rwbj⊤RwbiRbc[fci]×+[Rbc⊤Rwbj⊤RwbiRbcfci]×
第二部分
∂ 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} ∂δθcc′∂fcj2=∂δθcc′(I−[δθcc′]×)Rbc†(Rwbj†((Rwbipbc+pwbi)−pwbj)−pbc)=[Rbc⊤(Rwbj⊤((Rwbipbc+pwbi)−pwbj)−pbc)]×
两部分加起来就是视觉误差对外参的角度增量的最终结果
∂ 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=∂fci∂fcj∂δλ∂fci=Rbc⊤Rwbj⊤RwbiRbc(−λ21 ucivci1 )=−λ1Rbc⊤Rwbj⊤RwbiRbcfci