|
1234567891011121314151617181920212223242526272829303132333435363738 |
- import numpy as np
-
-
- # 双目相机参数
- class stereoCamera(object):
- def __init__(self):
- # 左相机内参
- self.cam_matrix_left = np.load("Camera matrix left.npy")
- # 右相机内参
- self.cam_matrix_right = np.load('CameraMatrix right.npy')
-
- # 左右相机畸变系数:[k1, k2, p1, p2, k3]
- self.distortion_l = np.load('distCoeffs left.npy')
- self.distortion_r = np.load('distCoeffs right.npy')
-
- # 旋转矩阵
- self.R = np.load('R.npy')
-
- # 平移矩阵
- self.T = np.load('T.npy')
-
- # 主点列坐标的差
- self.doffs = 0.0
-
- # 指示上述内外参是否为经过立体校正后的结果
- self.isRectified = False
-
- def setMiddleBurryParams(self):
- self.cam_matrix_left = np.load("Camera matrix left.npy")
- self.cam_matrix_right = np.load('CameraMatrix right.npy')
-
- self.distortion_l = np.load('distCoeffs left.npy') # 以下6行代码是添加的
- self.distortion_r = np.load('distCoeffs right.npy')
- self.R = np.load('R.npy')
- self.T = np.load('T.npy')
- self.doffs = 21.83546358
- self.isRectified = True
-
|