New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calibration.flip()函数的原理 #23
Comments
|
我使用了一个更简单的函数实现了这一功能(直接对内参进行操作,1.翻转后,0号相机与2号相机的相对位置刚好掉转,因此偏移量乘以-1;2.翻转时成像面也翻转了,因此相机的cu相对于图像中轴线也镜像翻转): def flip_simple(self, img_size):
img_w = img_size[0]
_cu = img_w - self.cu
self.cu = _cu
self.P2[0, 2] = _cu
self.tx *= -1
self.P2[0, 3] *= -1 最终算出来的结果与您的原函数有很小的误差,我感觉应该也是对的?: calib_1 = Calibration('./kitti/training/calib/000000.txt')
calib_2 = Calibration('./kitti/training/calib/000000.txt')
print("Raw P2:")
print(calib_1.P2)
calib_1.flip([1224, 370])
calib_2.flip_simple([1224, 370])
print("Raw Method:")
print(calib_1.P2)
print("Simple Method:")
print(calib_2.P2) |
正确的 |
你是对的,mmdet里也有类似的实现,这就是我说的更容易的那种实现,完全正确。
… 在 2022年7月2日,00:08,kwong292521 ***@***.***> 写道:
我使用了一个更简单的函数实现了这一功能(直接对内参进行操作,1.翻转后,0号相机与2号相机的相对位置刚好掉转,因此偏移量乘以-1;2.翻转时成像面也翻转了,因此相机的cu相对于图像中轴线也镜像翻转):
def flip_simple(self, img_size):
img_w = img_size[0]
_cu = img_w - self.cu
self.cu = _cu
self.P2[0, 2] = _cu
self.tx *= -1
self.P2[0, 3] *= -1
最终算出来的结果与您的原函数有很小的误差,我感觉应该也是对的?:
calib_1 = Calibration('./kitti/training/calib/000000.txt')
calib_2 = Calibration('./kitti/training/calib/000000.txt')
print("Raw P2:")
print(calib_1.P2)
calib_1.flip([1224, 370])
calib_2.flip_simple([1224, 370])
print("Raw Method:")
print(calib_1.P2)
print("Simple Method:")
print(calib_2.P2)
结果:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
作者你好,在数据增强的水平翻转操作中,若图像进行了翻转,那么相机的相关标定信息会发生变化。在您的代码中体现在kitti.py中的calib.flip(img_size)这一操作,但是我不是很理解函数中为什么要构造cos_matrix这个矩阵以及用奇异值分解来求解相关系数,因此想向您请教一下该函数的相关数学原理出处,期待回复,非常感谢!!!
The text was updated successfully, but these errors were encountered: