【三维重建】捆绑调整

2024-05-04 18:28
文章标签 调整 三维重建 捆绑

本文主要是介绍【三维重建】捆绑调整,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

捆绑调整的目的是通过重构的点计算重投影误差,利用最优化方法是重投影误差最小。这是一个典型的非线性最小二乘问题,利用高斯-牛顿法进行优化(高斯-牛顿法原理参考https://blog.csdn.net/holle_world_ldx/article/details/138225785)

在这里插入图片描述

求雅可比矩阵

一、相机投影过程

1、世界坐标系到相机坐标系的变换

[ x c y c z c ] = R X + t = [ r 0 r 1 r 2 r 3 r 4 r 5 r 6 r 7 r 8 ] [ X Y Z ] + [ t 0 t 1 t 2 ] \begin{bmatrix} x_c\\ y_c\\ z_c \end{bmatrix}=RX+t=\begin{bmatrix}r_0 & r_1 &r_2 \\ r_3 & r_4 & r_5 \\ r_6 &r_7 &r_8 \end{bmatrix} \begin{bmatrix}X\\Y\\Z \end{bmatrix}+\begin{bmatrix}t_0\\t_1\\t_2\end{bmatrix} xcyczc =RX+t= r0r3r6r1r4r7r2r5r8 XYZ + t0t1t2

2、归一化像平面

x c = r 0 X + r 1 Y + r 2 Z + t 0 y c = r 3 X + r 4 Y + r 5 Z + t 1 z c = r 6 X + r 7 Y + r 8 Z + t 2 [ x y ] = [ x c z c y c z c ] \begin{aligned} &x_c = r_0X +r_1Y+r_2Z +t_0 \\ &y_c = r_3X +r_4Y+r_5Z +t_1 \\ &z_c = r_6X +r_7Y+r_8Z +t_2 \\ &\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix} \frac{x_c}{z_c}\\\frac{y_c}{z_c}\end{bmatrix} \end{aligned} xc=r0X+r1Y+r2Z+t0yc=r3X+r4Y+r5Z+t1zc=r6X+r7Y+r8Z+t2[xy]=[zcxczcyc]

3、相机成像平面

[ u v ] = [ f d ( k 0 , k 1 , r 2 ) x f d ( k 0 , k 1 , r 2 ) y ] , d ( k 0 , k 1 , r 2 ) = 1 + ( k 0 + k 1 r 2 ) r 2 , r 2 = x 2 + y 2 \begin{bmatrix}u\\v\end{bmatrix}=\begin{bmatrix} fd(k_0,k_1,r^2)x \\fd(k_0,k_1,r^2)y\end{bmatrix}, \ d(k_0,k_1,r^2)=1+(k_0+k_1r^2)r^2,\ r^2=x^2+y^2 [uv]=[fd(k0,k1,r2)xfd(k0,k1,r2)y], d(k0,k1,r2)=1+(k0+k1r2)r2, r2=x2+y2

二、Jacobian矩阵推导

1、计算焦距的偏导数 ∂ u ∂ f , ∂ v ∂ f \frac{\partial u}{\partial f},\frac{\partial v}{\partial f} fu,fv

∂ u ∂ f = d ( k 0 , k 1 , r 2 ) x ∂ v ∂ f = d ( k 0 , k 1 , r 2 ) y \begin{aligned} \frac{\partial u}{\partial f}=d(k_0,k_1,r^2)x \\ \frac{\partial v}{\partial f}=d(k_0,k_1,r^2)y \end{aligned} fu=d(k0,k1,r2)xfv=d(k0,k1,r2)y

2、计算径向畸变系数 ∂ u ∂ k 0 , ∂ u ∂ k 1 , ∂ v ∂ k 0 , ∂ v ∂ k 1 \frac{\partial u}{\partial k_0},\frac{\partial u}{\partial k_1},\frac{\partial v}{\partial k_0},\frac{\partial v}{\partial k_1} k0u,k1u,k0v,k1v

引入中间变量:
∂ u ∂ d ( k 0 , k 1 , r 2 ) = f x ∂ v ∂ d ( k 0 , k 1 , r 2 ) = f y ∂ d ( k 0 , k 1 , r 2 ) ∂ d ( k 0 ) = r 2 ∂ d ( k 0 , k 1 , r 2 ) ∂ d ( k 1 ) = r 4 \begin{aligned} \frac{\partial u}{\partial d(k_0,k_1,r^2)} = fx \\ \frac{\partial v}{\partial d(k_0,k_1,r^2)} = fy \\ \frac{\partial d(k_0,k_1,r^2)}{\partial d(k_0)} = r^2 \\ \frac{\partial d(k_0,k_1,r^2)}{\partial d(k_1)} = r^4 \end{aligned} d(k0,k1,r2)u=fxd(k0,k1,r2)v=fyd(k0)d(k0,k1,r2)=r2d(k1)d(k0,k1,r2)=r4
根据链式法则:
∂ u ∂ k 0 = ∂ u ∂ d ( k 0 , k 1 , r 2 ) ∂ d ( k 0 , k 1 , r 2 ) k 0 = f x r 2 ∂ u ∂ k 1 = ∂ u ∂ d ( k 0 , k 1 , r 2 ) ∂ d ( k 0 , k 1 , r 2 ) k 1 = f x r 4 ∂ v ∂ k 0 = ∂ v ∂ d ( k 0 , k 1 , r 2 ) ∂ d ( k 0 , k 1 , r 2 ) k 0 = f y r 2 ∂ v ∂ k 1 = ∂ v ∂ d ( k 0 , k 1 , r 2 ) ∂ d ( k 0 , k 1 , r 2 ) k 1 = f y r 4 \begin{aligned} \frac{\partial u}{\partial k_0} = \frac{\partial u}{\partial d(k_0,k_1,r^2)} \frac{\partial d(k_0,k_1,r^2)}{k_0}=fxr^2 \\ \frac{\partial u}{\partial k_1} = \frac{\partial u}{\partial d(k_0,k_1,r^2)} \frac{\partial d(k_0,k_1,r^2)}{k_1}=fxr^4 \\ \frac{\partial v}{\partial k_0} = \frac{\partial v}{\partial d(k_0,k_1,r^2)} \frac{\partial d(k_0,k_1,r^2)}{k_0}=fyr^2 \\ \frac{\partial v}{\partial k_1} = \frac{\partial v}{\partial d(k_0,k_1,r^2)} \frac{\partial d(k_0,k_1,r^2)}{k_1}=fyr^4 \\ \end{aligned} k0u=d(k0,k1,r2)uk0d(k0,k1,r2)=fxr2k1u=d(k0,k1,r2)uk1d(k0,k1,r2)=fxr4k0v=d(k0,k1,r2)vk0d(k0,k1,r2)=fyr2k1v=d(k0,k1,r2)vk1d(k0,k1,r2)=fyr4

3、计算关于平移向量的偏导 ∂ u ∂ t 0 , ∂ u ∂ t 1 , ∂ u ∂ t 2 , ∂ v ∂ t 0 , ∂ v ∂ t 1 , ∂ v ∂ t 2 \frac{\partial u}{\partial t_0},\frac{\partial u}{\partial t_1},\frac{\partial u}{\partial t_2},\frac{\partial v}{\partial t_0},\frac{\partial v}{\partial t_1},\frac{\partial v}{\partial t_2} t0u,t1u,t2u,t0v,t1v,t2v

∂ x c ∂ t 0 = 1 , ∂ y c ∂ t 1 = 1 , ∂ z c ∂ t 2 = 1 ∂ x ∂ x c = 1 z c , ∂ y ∂ y c = 1 z c , ∂ x ∂ z c = − x c ( z c ) 2 , ∂ y ∂ z c = − y c ( z c ) 2 ∂ x ∂ t 0 = ∂ x ∂ x c ∂ x c ∂ t 0 , ∂ y ∂ t 1 = ∂ y ∂ y c ∂ y c ∂ t 1 , ∂ x ∂ t 2 = ∂ x ∂ z c ∂ z c ∂ t 2 , ∂ y ∂ t 2 = ∂ y ∂ z c ∂ z c ∂ t 2 ∂ r 2 ∂ x = 2 x , ∂ r 2 ∂ y = 2 y , ∂ r 2 ∂ t 0 = ∂ r 2 ∂ x ∂ x ∂ t 0 , ∂ r 2 ∂ t 1 = ∂ r 2 ∂ y ∂ y ∂ t 1 , ∂ r 2 ∂ t 2 = ∂ r 2 ∂ x ∂ x ∂ t 2 + ∂ r 2 ∂ y ∂ y ∂ t 2 ∂ d ∂ r 2 = k 0 + 2 k 1 r 2 , ∂ d ∂ t 0 = ∂ d ∂ r 2 ∂ r 2 ∂ t 0 , ∂ d ∂ t 1 = ∂ d ∂ r 2 ∂ r 2 ∂ t 1 , ∂ d ∂ t 2 = ∂ d ∂ r 2 ∂ r 2 ∂ t 2 ∂ d ∂ x = ∂ d ∂ r 2 ∂ r 2 ∂ x , ∂ u ∂ x = f d + f x ∂ d ∂ x , ∂ d ∂ y = ∂ d ∂ r 2 ∂ r 2 ∂ y , ∂ v ∂ y = f d + f y ∂ d ∂ y ∂ u ∂ t 0 = ∂ u ∂ d ∂ d ∂ t 0 x + ∂ u ∂ x ∂ x ∂ t 0 d , ∂ u ∂ t 1 = ∂ u ∂ d ∂ d ∂ t 1 x , ∂ u ∂ t 2 = ∂ u ∂ d ∂ d ∂ t 2 x + ∂ u ∂ x ∂ x ∂ t 2 d ∂ v ∂ t 0 = ∂ v ∂ d ∂ d ∂ t 0 y , ∂ v ∂ t 1 = ∂ v ∂ d ∂ d ∂ t 1 y + ∂ v ∂ y ∂ y ∂ t 1 d , ∂ v ∂ t 2 = ∂ v ∂ d ∂ d ∂ t 2 y + ∂ v ∂ y ∂ y ∂ t 2 d \begin{aligned} &\frac{\partial x_c}{\partial t_0}=1 ,{\kern 10pt} \frac{\partial y_c}{\partial t_1}=1 ,{\kern 10pt} \frac{\partial z_c}{\partial t_2}=1 \\ &\frac{\partial x}{\partial x_c}=\frac{1}{z_c} ,{\kern 10pt} \frac{\partial y}{\partial y_c}=\frac{1}{z_c} ,{\kern 10pt}\frac{\partial x}{\partial z_c}=-\frac{x_c}{(z_c)^2},{\kern 10pt} \frac{\partial y}{\partial z_c}=-\frac{y_c}{(z_c)^2} \\ &\frac{\partial x}{\partial t_0} = \frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial t_0},{\kern 10pt}\frac{\partial y}{\partial t_1} = \frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial t_1},{\kern 10pt}\frac{\partial x}{\partial t_2} = \frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial t_2},{\kern 10pt} \frac{\partial y}{\partial t_2} = \frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial t_2} \\ &\frac{\partial r^2}{\partial x} = 2x,{\kern 10pt}\frac{\partial r^2}{\partial y} = 2y,{\kern 10pt} \frac{\partial r^2}{\partial t_0} = \frac{\partial r^2}{\partial x}\frac{\partial x}{\partial t_0},{\kern 10pt}\frac{\partial r^2}{\partial t_1} = \frac{\partial r^2}{\partial y}\frac{\partial y}{\partial t_1},{\kern 10pt}\frac{\partial r^2}{\partial t_2} = \frac{\partial r^2}{\partial x}\frac{\partial x}{\partial t_2} + \frac{\partial r^2}{\partial y}\frac{\partial y}{\partial t_2}\\ &\frac{\partial d}{\partial r^2}=k_0 + 2 k_1r^2,{\kern 10pt}\frac{\partial d}{\partial t_0} = \frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial t_0} ,{\kern 10pt}\frac{\partial d}{\partial t_1} = \frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial t_1} ,{\kern 10pt}\frac{\partial d}{\partial t_2} = \frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial t_2}\\ &\frac{\partial d}{\partial x}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial x} ,{\kern 10pt}\frac{\partial u}{\partial x} = fd+fx\frac{\partial d}{\partial x} ,{\kern 10pt}\frac{\partial d}{\partial y}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial y} ,{\kern 10pt}\frac{\partial v}{\partial y} = fd+fy\frac{\partial d}{\partial y} \\ &\color{red} \frac{\partial u}{\partial t_0} = \frac{\partial u}{\partial d}\frac{\partial d}{\partial t_0}x +\frac{\partial u}{\partial x}\frac{\partial x}{\partial t_0}d ,{\kern 10pt}\frac{\partial u}{\partial t_1} = \frac{\partial u}{\partial d}\frac{\partial d}{\partial t_1}x,{\kern 10pt}\frac{\partial u}{\partial t_2} = \frac{\partial u}{\partial d}\frac{\partial d}{\partial t_2}x +\frac{\partial u}{\partial x}\frac{\partial x}{\partial t_2}d \color{black}\\ &\color{red} \frac{\partial v}{\partial t_0} = \frac{\partial v}{\partial d}\frac{\partial d}{\partial t_0}y ,{\kern 10pt}\frac{\partial v}{\partial t_1} = \frac{\partial v}{\partial d}\frac{\partial d}{\partial t_1}y+\frac{\partial v}{\partial y}\frac{\partial y}{\partial t_1}d,{\kern 10pt}\frac{\partial v}{\partial t_2} = \frac{\partial v}{\partial d}\frac{\partial d}{\partial t_2}y +\frac{\partial v}{\partial y}\frac{\partial y}{\partial t_2}d \color{black} \end{aligned} t0xc=1,t1yc=1,t2zc=1xcx=zc1,ycy=zc1,zcx=(zc)2xc,zcy=(zc)2yct0x=xcxt0xc,t1y=ycyt1yc,t2x=zcxt2zc,t2y=zcyt2zcxr2=2x,yr2=2y,t0r2=xr2t0x,t1r2=yr2t1y,t2r2=xr2t2x+yr2t2yr2d=k0+2k1r2,t0d=r2dt0r2,t1d=r2dt1r2,t2d=r2dt2r2xd=r2dxr2,xu=fd+fxxd,yd=r2dyr2,yv=fd+fyydt0u=dut0dx+xut0xd,t1u=dut1dx,t2u=dut2dx+xut2xdt0v=dvt0dy,t1v=dvt1dy+yvt1yd,t2v=dvt2dy+yvt2yd

4、计算关于旋转向量的偏导 ∂ u ∂ r 0 , ∂ u ∂ r 2 , ∂ u ∂ r 3 , ∂ u ∂ r 4 , ∂ u ∂ r 5 , ∂ u ∂ r 6 , ∂ u ∂ r 7 , ∂ u ∂ r 8 \frac{\partial u}{\partial r_0},\frac{\partial u}{\partial r_2},\frac{\partial u}{\partial r_3},\frac{\partial u}{\partial r_4},\frac{\partial u}{\partial r_5},\frac{\partial u}{\partial r_6},\frac{\partial u}{\partial r_7},\frac{\partial u}{\partial r_8} r0u,r2u,r3u,r4u,r5u,r6u,r7u,r8u ∂ v ∂ r 0 , ∂ v ∂ r 2 , ∂ v ∂ r 3 , ∂ v ∂ r 4 , ∂ v ∂ r 5 , ∂ v ∂ r 6 , ∂ v ∂ r 7 , ∂ v ∂ r 8 \frac{\partial v}{\partial r_0},\frac{\partial v}{\partial r_2},\frac{\partial v}{\partial r_3},\frac{\partial v}{\partial r_4},\frac{\partial v}{\partial r_5},\frac{\partial v}{\partial r_6},\frac{\partial v}{\partial r_7},\frac{\partial v}{\partial r_8} r0v,r2v,r3v,r4v,r5v,r6v,r7v,r8v

∂ x c ∂ r 0 = ∂ y c ∂ r 3 = ∂ z c ∂ r 6 = X , ∂ x c ∂ r 1 = ∂ y c ∂ r 4 = ∂ z c ∂ r 7 = Y , ∂ x c ∂ r 2 = ∂ y c ∂ r 5 = ∂ z c ∂ r 8 = Z ∂ r 2 ∂ r 0 = ∂ r 2 ∂ x ∂ x ∂ x c ∂ x c ∂ r 0 , ∂ r 2 ∂ r 1 = ∂ r 2 ∂ x ∂ x ∂ x c ∂ x c ∂ r 1 , ∂ r 2 ∂ r 2 = ∂ r 2 ∂ x ∂ x ∂ x c ∂ x c ∂ r 2 ∂ r 2 ∂ r 3 = ∂ r 2 ∂ y ∂ y ∂ y c ∂ y c ∂ r 3 , ∂ r 2 ∂ r 4 = ∂ r 2 ∂ y ∂ y ∂ y c ∂ y c ∂ r 4 , ∂ r 2 ∂ r 5 = ∂ r 2 ∂ y ∂ y ∂ y c ∂ y c ∂ r 5 ∂ r 2 ∂ r 6 = ∂ r 2 ∂ x ∂ x ∂ z c ∂ z c ∂ r 6 + ∂ r 2 ∂ y ∂ y ∂ z c ∂ z c ∂ r 6 , ∂ r 2 ∂ r 7 = ∂ r 2 ∂ x ∂ x ∂ z c ∂ z c ∂ r 7 + ∂ r 2 ∂ y ∂ y ∂ z c ∂ z c ∂ r 7 , ∂ r 2 ∂ r 8 = ∂ r 2 ∂ x ∂ x ∂ z c ∂ z c ∂ r 8 + ∂ r 2 ∂ y ∂ y ∂ z c ∂ z c ∂ r 8 ∂ d ∂ r 0 = ∂ d ∂ r 2 ∂ r 2 ∂ r 0 , ∂ d ∂ r 1 = ∂ d ∂ r 2 ∂ r 2 ∂ r 1 , ∂ d ∂ r 2 = ∂ d ∂ r 2 ∂ r 2 ∂ r 2 ∂ d ∂ r 3 = ∂ d ∂ r 2 ∂ r 2 ∂ r 3 , ∂ d ∂ r 4 = ∂ d ∂ r 2 ∂ r 2 ∂ r 4 , ∂ d ∂ r 5 = ∂ d ∂ r 2 ∂ r 2 ∂ r 5 ∂ d ∂ r 6 = ∂ d ∂ r 2 ∂ r 2 ∂ r 6 , ∂ d ∂ r 7 = ∂ d ∂ r 2 ∂ r 2 ∂ r 7 , ∂ d ∂ r 8 = ∂ d ∂ r 2 ∂ r 2 ∂ r 8 ∂ x ∂ r 0 = ∂ x ∂ x c ∂ x c ∂ r 0 , ∂ x ∂ r 1 = ∂ x ∂ x c ∂ x c ∂ r 1 , ∂ x ∂ r 2 = ∂ x ∂ x c ∂ x c ∂ r 2 , ∂ x ∂ r 6 = ∂ x ∂ z c ∂ z c ∂ r 6 , ∂ x ∂ r 7 = ∂ x ∂ z c ∂ z c ∂ r 7 , ∂ x ∂ r 8 = ∂ x ∂ z c ∂ z c ∂ r 8 ∂ u ∂ r 0 = f x ∂ d ∂ r 0 + f d ∂ x ∂ r 0 , ∂ u ∂ r 1 = f x ∂ d ∂ r 1 + f d ∂ x ∂ r 1 , ∂ u ∂ r 2 = f x ∂ d ∂ r 2 + f d ∂ x ∂ r 2 ∂ u ∂ r 3 = f x ∂ d ∂ r 3 , ∂ u ∂ r 4 = f x ∂ d ∂ r 4 , ∂ u ∂ r 5 = f x ∂ d ∂ r 5 ∂ u ∂ r 6 = f x ∂ d ∂ r 6 + f d ∂ x ∂ r 6 , ∂ u ∂ r 7 = f x ∂ d ∂ r 7 + f d ∂ x ∂ r 7 , ∂ u ∂ r 8 = f x ∂ d ∂ r 8 + f d ∂ x ∂ r 8 ∂ y ∂ r 3 = ∂ y ∂ y c ∂ y c ∂ r 3 , ∂ y ∂ r 4 = ∂ y ∂ y c ∂ y c ∂ r 4 , ∂ y ∂ r 5 = ∂ y ∂ y c ∂ y c ∂ r 5 , ∂ y ∂ r 6 = ∂ y ∂ z c ∂ z c ∂ r 6 , ∂ y ∂ r 7 = ∂ y ∂ z c ∂ z c ∂ r 7 , ∂ y ∂ r 8 = ∂ y ∂ z c ∂ z c ∂ r 8 ∂ v ∂ r 0 = f y ∂ d ∂ r 0 , ∂ v ∂ r 1 = f y ∂ d ∂ r 1 , ∂ v ∂ r 2 = f y ∂ d ∂ r 2 ∂ v ∂ r 3 = f y ∂ d ∂ r 3 + f d ∂ y ∂ r 3 , ∂ v ∂ r 4 = f y ∂ d ∂ r 4 + f d ∂ y ∂ r 4 , ∂ v ∂ r 5 = f u ∂ d ∂ r 5 + f d ∂ y ∂ r 5 ∂ v ∂ r 6 = f y ∂ d ∂ r 6 + f d ∂ y ∂ r 6 , ∂ v ∂ r 7 = f y ∂ d ∂ r 7 + f d ∂ y ∂ r 7 , ∂ v ∂ r 8 = f y ∂ d ∂ r 8 + f d ∂ y ∂ r 8 \begin{aligned} &\frac{\partial x_c}{\partial r_0} =\frac{\partial y_c}{\partial r_3} =\frac{\partial z_c}{\partial r_6} = X ,{\kern 10pt}\frac{\partial x_c}{\partial r_1} =\frac{\partial y_c}{\partial r_4} =\frac{\partial z_c}{\partial r_7} = Y ,{\kern 10pt}\frac{\partial x_c}{\partial r_2} =\frac{\partial y_c}{\partial r_5} = \frac{\partial z_c}{\partial r_8} = Z \\\\ &\frac{\partial r^2}{\partial r_0}=\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial r_0},{\kern 10pt}\frac{\partial r^2}{\partial r_1}=\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial r_1},{\kern 10pt}\frac{\partial r^2}{\partial r_2}=\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial r_2}\\ & \frac{\partial r^2}{\partial r_3}=\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial r_3},{\kern 10pt}\frac{\partial r^2}{\partial r_4}=\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial r_4} ,{\kern 10pt}\frac{\partial r^2}{\partial r_5}=\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial r_5} \\ & \frac{\partial r^2}{\partial r_6}=\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial r_6}+\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial r_6},{\kern 10pt}\frac{\partial r^2}{\partial r_7}=\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial r_7}+\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial r_7},{\kern 10pt}\frac{\partial r^2}{\partial r_8}=\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial r_8}+\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial r_8}\\\\ &\frac{\partial d}{\partial r_0}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_0},{\kern 10pt}\frac{\partial d}{\partial r_1}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_1},{\kern 10pt}\frac{\partial d}{\partial r_2}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_2}\\ &\frac{\partial d}{\partial r_3}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_3},{\kern 10pt}\frac{\partial d}{\partial r_4}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_4},{\kern 10pt}\frac{\partial d}{\partial r_5}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_5} \\ &\frac{\partial d}{\partial r_6}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_6},{\kern 10pt}\frac{\partial d}{\partial r_7}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_7},{\kern 10pt}\frac{\partial d}{\partial r_8}=\frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial r_8} \\\\ &\frac{\partial x}{\partial r_0}=\frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial r_0},{\kern 10pt}\frac{\partial x}{\partial r_1}=\frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial r_1},{\kern 10pt}\frac{\partial x}{\partial r_2}=\frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial r_2},{\kern 10pt} \frac{\partial x}{\partial r_6}=\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial r_6},{\kern 10pt}\frac{\partial x}{\partial r_7}=\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial r_7},{\kern 10pt}\frac{\partial x}{\partial r_8}=\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial r_8} \\\\ &\color{red}\frac{\partial u}{\partial r_0} = fx\frac{\partial d}{\partial r_0}+fd\frac{\partial x}{\partial r_0},{\kern 10pt}\frac{\partial u}{\partial r_1} = fx\frac{\partial d}{\partial r_1}+fd\frac{\partial x}{\partial r_1},{\kern 10pt}\frac{\partial u}{\partial r_2} = fx\frac{\partial d}{\partial r_2}+fd\frac{\partial x}{\partial r_2}\\ &\color{red}\frac{\partial u}{\partial r_3} = fx\frac{\partial d}{\partial r_3},{\kern 10pt}\frac{\partial u}{\partial r_4} = fx\frac{\partial d}{\partial r_4},{\kern 10pt}\frac{\partial u}{\partial r_5} = fx\frac{\partial d}{\partial r_5}\\ &\color{red}\frac{\partial u}{\partial r_6} = fx\frac{\partial d}{\partial r_6}+fd\frac{\partial x}{\partial r_6},{\kern 10pt}\frac{\partial u}{\partial r_7} = fx\frac{\partial d}{\partial r_7}+fd\frac{\partial x}{\partial r_7},{\kern 10pt}\frac{\partial u}{\partial r_8} = fx\frac{\partial d}{\partial r_8}+fd\frac{\partial x}{\partial r_8}\\\\ &\frac{\partial y}{\partial r_3}=\frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial r_3},{\kern 10pt}\frac{\partial y}{\partial r_4}=\frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial r_4},{\kern 10pt}\frac{\partial y}{\partial r_5}=\frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial r_5},{\kern 10pt} \frac{\partial y}{\partial r_6}=\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial r_6},{\kern 10pt}\frac{\partial y}{\partial r_7}=\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial r_7},{\kern 10pt}\frac{\partial y}{\partial r_8}=\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial r_8} \\\\ &\color{red}\frac{\partial v}{\partial r_0} = fy\frac{\partial d}{\partial r_0},{\kern 10pt}\frac{\partial v}{\partial r_1} = fy\frac{\partial d}{\partial r_1},{\kern 10pt}\frac{\partial v}{\partial r_2} = fy\frac{\partial d}{\partial r_2}\\ &\color{red}\frac{\partial v}{\partial r_3} = fy\frac{\partial d}{\partial r_3}+fd\frac{\partial y}{\partial r_3},{\kern 10pt}\frac{\partial v}{\partial r_4} = fy\frac{\partial d}{\partial r_4}+fd\frac{\partial y}{\partial r_4},{\kern 10pt}\frac{\partial v}{\partial r_5} = fu\frac{\partial d}{\partial r_5}+fd\frac{\partial y}{\partial r_5}\\ &\color{red}\frac{\partial v}{\partial r_6} = fy\frac{\partial d}{\partial r_6}+fd\frac{\partial y}{\partial r_6},{\kern 10pt}\frac{\partial v}{\partial r_7} = fy\frac{\partial d}{\partial r_7}+fd\frac{\partial y}{\partial r_7},{\kern 10pt}\frac{\partial v}{\partial r_8} = fy\frac{\partial d}{\partial r_8}+fd\frac{\partial y}{\partial r_8}\\ \end{aligned} r0xc=r3yc=r6zc=X,r1xc=r4yc=r7zc=Y,r2xc=r5yc=r8zc=Zr0r2=xr2xcxr0xc,r1r2=xr2xcxr1xc,r2r2=xr2xcxr2xcr3r2=yr2ycyr3yc,r4r2=yr2ycyr4yc,r5r2=yr2ycyr5ycr6r2=xr2zcxr6zc+yr2zcyr6zc,r7r2=xr2zcxr7zc+yr2zcyr7zc,r8r2=xr2zcxr8zc+yr2zcyr8zcr0d=r2dr0r2,r1d=r2dr1r2,r2d=r2dr2r2r3d=r2dr3r2,r4d=r2dr4r2,r5d=r2dr5r2r6d=r2dr6r2,r7d=r2dr7r2,r8d=r2dr8r2r0x=xcxr0xc,r1x=xcxr1xc,r2x=xcxr2xc,r6x=zcxr6zc,r7x=zcxr7zc,r8x=zcxr8zcr0u=fxr0d+fdr0x,r1u=fxr1d+fdr1x,r2u=fxr2d+fdr2xr3u=fxr3d,r4u=fxr4d,r5u=fxr5dr6u=fxr6d+fdr6x,r7u=fxr7d+fdr7x,r8u=fxr8d+fdr8xr3y=ycyr3yc,r4y=ycyr4yc,r5y=ycyr5yc,r6y=zcyr6zc,r7y=zcyr7zc,r8y=zcyr8zcr0v=fyr0d,r1v=fyr1d,r2v=fyr2dr3v=fyr3d+fdr3y,r4v=fyr4d+fdr4y,r5v=fur5d+fdr5yr6v=fyr6d+fdr6y,r7v=fyr7d+fdr7y,r8v=fyr8d+fdr8y

5、计算关于三维点的偏导数 ∂ u ∂ X , ∂ u ∂ Y , ∂ u ∂ Z , ∂ v ∂ X , ∂ v ∂ Y , ∂ v ∂ Z \frac{\partial u}{\partial X},\frac{\partial u}{\partial Y},\frac{\partial u}{\partial Z},\frac{\partial v}{\partial X},\frac{\partial v}{\partial Y},\frac{\partial v}{\partial Z} Xu,Yu,Zu,Xv,Yv,Zv

∂ x c ∂ X = r 0 , ∂ x c ∂ Y = r 1 , ∂ x c ∂ Z = r 2 ∂ y c ∂ X = r 3 , ∂ y c ∂ Y = r 4 , ∂ y c ∂ Z = r 5 ∂ z c ∂ X = r 6 , ∂ z c ∂ Y = r 7 , ∂ z c ∂ Z = r 8 ∂ x ∂ X = ∂ x ∂ x c ∂ x c ∂ X + ∂ x ∂ z c ∂ z c ∂ X , ∂ y ∂ X = ∂ y ∂ y c ∂ y c ∂ X + ∂ y ∂ z c ∂ z c ∂ X ∂ x ∂ Y = ∂ x ∂ x c ∂ x c ∂ Y + ∂ x ∂ z c ∂ z c ∂ Y , ∂ y ∂ Y = ∂ y ∂ y c ∂ y c ∂ Y + ∂ y ∂ z c ∂ z c ∂ Y ∂ x ∂ Z = ∂ x ∂ x c ∂ x c ∂ Z + ∂ x ∂ z c ∂ z c ∂ Z , ∂ y ∂ Z = ∂ y ∂ y c ∂ y c ∂ Z + ∂ y ∂ z c ∂ z c ∂ Z ∂ r 2 ∂ X = ∂ r 2 ∂ x ∂ x ∂ X + ∂ r 2 ∂ y ∂ y ∂ X , ∂ r 2 ∂ Y = ∂ r 2 ∂ x ∂ x ∂ Y + ∂ r 2 ∂ y ∂ y ∂ Y , ∂ r 2 ∂ Z = ∂ r 2 ∂ x ∂ x ∂ Z + ∂ r 2 ∂ y ∂ y ∂ Z ∂ d ∂ X = ∂ d ∂ r 2 ∂ r 2 ∂ X , ∂ d ∂ Y = ∂ d ∂ r 2 ∂ r 2 ∂ Y , ∂ d ∂ Z = ∂ d ∂ r 2 ∂ r 2 ∂ Z ∂ u ∂ X = f x ∂ d ∂ X + f d ∂ x ∂ X , ∂ u ∂ Y = f x ∂ d ∂ Y + f d ∂ x ∂ Y , ∂ u ∂ Z = f x ∂ d ∂ Z + f d ∂ x ∂ Z ∂ v ∂ X = f y ∂ d ∂ X + f d ∂ y ∂ X , ∂ v ∂ Y = f y ∂ d ∂ Y + f d ∂ y ∂ Y , ∂ v ∂ Z = f y ∂ d ∂ Z + f d ∂ y ∂ Z \begin{aligned} &\frac{\partial x_c}{\partial X} = r0,{\kern 10pt}\frac{\partial x_c}{\partial Y} = r1,{\kern 10pt}\frac{\partial x_c}{\partial Z} = r2 \\ &\frac{\partial y_c}{\partial X} = r3,{\kern 10pt}\frac{\partial y_c}{\partial Y} = r4,{\kern 10pt}\frac{\partial y_c}{\partial Z} = r5 \\ &\frac{\partial z_c}{\partial X} = r6,{\kern 10pt}\frac{\partial z_c}{\partial Y} = r7,{\kern 10pt}\frac{\partial z_c}{\partial Z} = r8 \\\\ &\frac{\partial x}{\partial X} = \frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial X}+\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial X},{\kern 10pt}\frac{\partial y}{\partial X} = \frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial X}+\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial X}\\ &\frac{\partial x}{\partial Y} = \frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial Y}+\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial Y},{\kern 10pt}\frac{\partial y}{\partial Y} = \frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial Y}+\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial Y}\\ &\frac{\partial x}{\partial Z} = \frac{\partial x}{\partial x_c}\frac{\partial x_c}{\partial Z}+\frac{\partial x}{\partial z_c}\frac{\partial z_c}{\partial Z},{\kern 10pt}\frac{\partial y}{\partial Z} = \frac{\partial y}{\partial y_c}\frac{\partial y_c}{\partial Z}+\frac{\partial y}{\partial z_c}\frac{\partial z_c}{\partial Z} \\\\ &\frac{\partial r^2}{\partial X} =\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial X}+\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial X},{\kern 10pt}\frac{\partial r^2}{\partial Y} =\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial Y}+\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial Y},{\kern 10pt}\frac{\partial r^2}{\partial Z} =\frac{\partial r^2}{\partial x}\frac{\partial x}{\partial Z}+\frac{\partial r^2}{\partial y}\frac{\partial y}{\partial Z}\\\\ &\frac{\partial d}{\partial X} = \frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial X},{\kern 10pt}\frac{\partial d}{\partial Y} = \frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial Y},{\kern 10pt}\frac{\partial d}{\partial Z} = \frac{\partial d}{\partial r^2}\frac{\partial r^2}{\partial Z}\\ &\color{red}\frac{\partial u}{\partial X} = fx\frac{\partial d}{\partial X}+ fd\frac{\partial x}{\partial X},{\kern 10pt}\frac{\partial u}{\partial Y} = fx\frac{\partial d}{\partial Y}+ fd\frac{\partial x}{\partial Y} ,{\kern 10pt}\frac{\partial u}{\partial Z} = fx\frac{\partial d}{\partial Z}+ fd\frac{\partial x}{\partial Z}\\ &\color{red}\frac{\partial v}{\partial X} = fy\frac{\partial d}{\partial X}+ fd\frac{\partial y}{\partial X},{\kern 10pt}\frac{\partial v}{\partial Y} = fy\frac{\partial d}{\partial Y}+ fd\frac{\partial y}{\partial Y} ,{\kern 10pt}\frac{\partial v}{\partial Z} = fy\frac{\partial d}{\partial Z}+ fd\frac{\partial y}{\partial Z} \end{aligned} Xxc=r0,Yxc=r1,Zxc=r2Xyc=r3,Yyc=r4,Zyc=r5Xzc=r6,Yzc=r7,Zzc=r8Xx=xcxXxc+zcxXzc,Xy=ycyXyc+zcyXzcYx=xcxYxc+zcxYzc,Yy=ycyYyc+zcyYzcZx=xcxZxc+zcxZzc,Zy=ycyZyc+zcyZzcXr2=xr2Xx+yr2Xy,Yr2=xr2Yx+yr2Yy,Zr2=xr2Zx+yr2ZyXd=r2dXr2,Yd=r2dYr2,Zd=r2dZr2Xu=fxXd+fdXx,Yu=fxYd+fdYx,Zu=fxZd+fdZxXv=fyXd+fdXy,Yv=fyYd+fdYy,Zv=fyZd+fdZy

代码实现

https://github.com/ldx-star/Bundle-Adjustment

这篇关于【三维重建】捆绑调整的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/959832

相关文章

Python批量调整Word文档中的字体、段落间距及格式

《Python批量调整Word文档中的字体、段落间距及格式》这篇文章主要为大家详细介绍了如何使用Python的docx库来批量处理Word文档,包括设置首行缩进、字体、字号、行间距、段落对齐方式等,需... 目录关键代码一级标题设置  正文设置完整代码运行结果最近关于批处理格式的问题我查了很多资料,但是都没

安卓实现弹出软键盘屏幕自适应调整

今天,我通过尝试诸多方法,最终实现了软键盘弹出屏幕的自适应。      其实,一开始我想通过EditText的事件来实现,后来发现,安卓自带的函数十分强大,只需几行代码,便可实现。实现如下:     在Manifest中设置activity的属性:android:windowSoftInputMode="adjustUnspecified|stateHidden|adjustResi

如何调整c盘分区大小,怎样把c盘空间调整小些

新买的笔记本电脑回来后发现电脑只分了C盘和D盘两个区,C盘就占了很大的空间,如何调整c盘分区大小,这样可以多腾些空间出来利用呢?虽然Win7有磁盘管理器可以压缩分区实现把C盘调小些,但是它的功能有限,压缩后也是很大一部分空间在C盘浪费,那怎样把c盘空间调整小些呢,下载我们介绍一个工具来完成这些复杂的动作:   1、下载安装分区助手DiskTool中文版。   在主界面上你可以看到C盘有60

java调整日期时间显示格式

SimpleDateFormat是一个以语言环境敏感的方式来格式化和分析日期的类。SimpleDateFormat允许你选择任何用户自定义日期时间格式来运行。 import java.util.*;import java.text.*;public class DateDemo {public static void main(String args[]) {Date dNow =

Android12——Launcher3文件夹布局修改调整

文章声明:本文是笔者参考良心大佬作品后结合实际需求进行相应的定制,本篇主要是笔者记录一次解析bug笔记,文中可能会引用大佬文章中的部分图片在此声明,并非盈利目的,如涉嫌侵权请私信,谢谢! 大佬原文:安卓开发- 安卓13 Launcher3文件夹预览图、文件夹展开后布局修改-CSDN博客文章浏览阅读305次,点赞5次,收藏8次。Android 13 Launcher3 文件夹预览图标溢出、文件夹展

麦克风MIC 工作原理以及灵敏度调整

https://blog.csdn.net/Charles0512/article/details/50472467?locationNum=6&fps=1 1、先看MIC电路连接 这是个差分输入的例子,MICP2和MICN2是一对差分信号,经过C156的滤波,输入到MIC两端 MIC两引脚分别是到地和供电,上图的R177参数就关系到MIC输入的灵敏度 2、电阻R177影响灵敏度分析 M

ExoPlayer 漫谈之Sonic调整音量

提一个问题:如何在播放视频的时候调整声音的大小? 我们使用Android手机播放视频的时候,发现声音大了,我们手动调低音量;发现声音小了,我们手动调高音量。 这个过程中,都要依赖手动,如果你在不断地刷短视频的时候,如果需要用户不断地手动调整音量键,那这个体验是不能忍受的。 这对我们提了一个要求:我们能在解码音频流的时候通过矩阵运算调整音频原始数据的大小,达到调整音量的目的? 这个思路是可行

6.1.数据结构-c/c++模拟实现堆上篇(向下,上调整算法,建堆,增删数据)

目录 一.堆(Heap)的基本介绍 二.堆的常用操作(以小根堆为例) 三.实现代码 3.1 堆结构定义 3.2 向下调整算法* 3.3 初始化堆* 3.4 销毁堆 3.4 向上调整算法*  3.5 插入数据 3.6 删除数据 3.7 返回堆顶数据 四.下篇内容 1.堆排序 2.TopK问题 一.堆(Heap)的基本介绍         了解堆之前我们要简

PyTorch Demo-3 : 动态调整学习率

# 一些必要的库和参数import torchimport torch.nn as nnfrom torchvision import modelsimport matplotlib.pyplot as pltimport numpy as np 以SGD为例 model = models.resnet18()init_lr = 0.1optimizer = torch.opti

硕士毕业论文页眉页码根据要求调整

最近写毕业论文,在排版方面进行了一些摸索,其中有一个问题可能是每个想把自己论文形式上弄得美观一点的同学都会碰到:在每一章的奇数页上插入该章标题,偶数页上插入论文题目,但正文页码要求连续。我查阅了一些资料,发现很多人的讲的不是很清楚,下面我把步骤总结如下(我用的是OFFICE2007): 第一步:光标放在每一章前面,插入分节符。具体操作:光标放在该章前面——页面布局——分隔符——(分节符)下