在ZED双目相机中,用户需要提供下面所示的参数,其中第一个参数可以理解为最终两个Rectification后的等效相机的内参数,所以各项畸变系数都为零,并且只有一套内参数fx fy。
Stereo Rectification的计算需要提供的参数有实际的内参数和实际的畸变参数以及目标的内参数矩阵。LEFT.D是左相机的原始畸变系数,LEFT.K是左相机的原始内参数矩阵,LEFT.R是左相机的原始旋转矩阵。有个特殊的地方两个相机的原始旋转矩阵没有一个等于单位阵,可能都是相对一个世界坐标系的旋转矩阵。 最终的期望投影矩阵P在两个相机中基本相等,除了平移部分的基线偏移,其中各项参数是下表开始 部分人工指定的一套内参数。 旋转矩阵如人所愿,都为单位阵,因此在投影矩阵中没有特别的反映出来。 投影矩阵中唯一不同的项目是第一行最后一列,右相机为47.9,单位应为mm,即基线为5cm左右。
如果直接采用ZED给出的图像其实并不需要进行校正,因为ZED已经做好了。
https://github.com/stereolabs/zed-ros-wrapper/issues/39
http://www.diegm.uniud.it/fusiello/papers/00120016.pdf
http://www.diegm.uniud.it/fusiello/papers/mva10.pdf
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 435.2046959714599
Camera.fy: 435.2046959714599
Camera.cx: 367.4517211914062
Camera.cy: 252.2008514404297
Camera.k1:0.0
Camera.k2: 0.0
Camera.p1: 0.0
Camera.p2: 0.0
Camera.width: 752
Camera.height: 480
# Camera frames per second
Camera.fps: 20.0
# stereo baseline times fx
Camera.bf: 47.90639384423901
# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
Camera.RGB: 1
# Close/Far threshold. Baseline times.
ThDepth: 35
#--------------------------------------------------------------------------------------------
# Stereo Rectification. Only if you need to pre-rectify the images.
# Camera.fx, .fy, etc must be the same as in LEFT.P
#--------------------------------------------------------------------------------------------
########################## 左相机参数 ###############################
LEFT.height: 480
LEFT.width: 752
LEFT.D: !!opencv-matrix
rows: 1
cols: 5
dt: d
data:[-0.28340811, 0.07395907, 0.00019359, 1.76187114e-05, 0.0]
LEFT.K: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [458.654 , 0.0 , 367.215,
0.0 , 457.296 , 248.375,
0.0 , 0.0 , 1.0]
LEFT.R: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [0.999966347530033 , -0.001422739138722922 , 0.008079580483432283,
0.001365741834644127 , 0.9999741760894847 , 0.007055629199258132,
-0.008089410156878961, -0.007044357138835809 , 0.9999424675829176]
LEFT.P: !!opencv-matrix
rows: 3
cols: 4
dt: d
data: [435.2046959714599, 0 , 367.4517211914062, 0,
0, 435.2046959714599 , 252.2008514404297, 0,
0, 0 , 1 , 0]
########################## 右相机参数 ################################
RIGHT.height: 480
RIGHT.width: 752
RIGHT.D: !!opencv-matrix
rows: 1
cols: 5
dt: d
data:[-0.28368365, 0.07451284, -0.00010473, -3.555907e-05, 0.0]
RIGHT.K: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [ 457.587 , 0.0 , 379.999,
0.0 , 456.134 , 255.238,
0.0 , 0.0 , 1]
RIGHT.R: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [0.9999633526194376, -0.003625811871560086, 0.007755443660172947,
0.003680398547259526, 0.9999684752771629, -0.007035845251224894,
-0.007729688520722713, 0.007064130529506649, 0.999945173484644]
RIGHT.P: !!opencv-matrix
rows: 3
cols: 4
dt: d
data: [435.2046959714599 , 0 , 367.4517211914062, -47.90639384423901,
0 , 435.2046959714599 , 252.2008514404297, 0 ,
0 , 0 , 1 , 0]