openCV失真校准分辨率缩放

2024-05-23 22:37:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是一个相机矩阵和无失真系数,我找到了一些GoPro镜头的here(因为我不幸地不再有权使用GoPro来校准自己的镜头),它似乎对1280*960(4:3)来说足够了,但是,我遇到了一些更大分辨率(3840*2880(4:3))的问题。在

According to the openCV documentation

While the distortion coefficients are the same regardless of the camera resolutions used, these should be scaled along with the current resolution from the calibrated resolution.

these是指相机矩阵吗?缩放摄影机矩阵的确切步骤是什么?我尝试了线性插值(X行与宽度比和Y行与高度比的标量乘法),图像更好,但仍然不太正确。这可能是因为校准镜头的视频宽高比(16:9)和我的镜头不太一样吗?如果是这样的话,为什么误差也不能线性缩放呢?在

例如

f_x_target = f_x_calibration * targetWidth / calibrationWidth
c_x_target = c_x_calibration * targetWidth / calibrationWidth
f_y_target = f_y_calibration * targetHeight / calibrationHeight
c_y_target = c_y_calibration * targetHeight / calibrationHeight

Tags: thetargethere矩阵镜头校准calibration系数