使用网格目标确定成像系统的失真

问题描述 投票:0回答:0

我尝试确定成像系统的失真。由于技术原因,我只能使用网格目标。 Sample Image of a grid target

我按照此处描述的使用 cv2 的方法进行操作:https://opencv24-python-tutorials.readthedocs.io/en/stable/py_tutorials/py_calib3d/py_calibration/py_calibration.html

使用 cv2.findChessboardCorners() 不起作用。很公平,我没有棋盘。 但是我“手动”确定了网格点,效果很好。 Grid points are shown in orange

但是,按照 cv2 的代码示例,我得到了这个:

ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera([objp], [corners], img.shape[::-1], None, None)

ret = 403.18434311612924 

mtx = [[2.15648501e+04 0.00000000e+00 6.60463129e+02]
      [0.00000000e+00 4.83041078e+05 5.08963085e+02]
      [0.00000000e+00 0.00000000e+00 1.00000000e+00]] 

dist = [[ 2.25904915e+03  6.07202692e-03  2.83113951e+00 -9.49974797e+00  1.69976610e-08]] 

rvecs = (array([[-0.59541192],
        [-1.49725611],
        [-0.56402402]]),) 

tvecs = (array([[ 1.2836315e+01],
        [-1.8945857e+01],
        [ 1.7703286e+04]]),)

然后我尝试 cv2.undistort() 并得到一个非常奇怪的图像Undistortion gone wrong

这里有什么问题吗?我没有收到任何错误。

我试图使用 gimp 人为地扭曲图像。也许原始图像中的失真太低而无法使用。然而,结果也不尽如人意。

python image cv2 distortion camera-distortion
© www.soinside.com 2019 - 2024. All rights reserved.