我正在尝试使用 OpenCV 的“不失真点”方法对图像的某些点进行不失真处理,但没有成功。
这些将是我的不失真系数
optic_camera_matrix: [[710.52285, 0.0, 882.14702],
[0.0, 713.9636, 638.8421],
[0.0, 0.0, 1.0]],
distorsion_coeffs: [[-0.4176419401669212,
0.15978235598732332,
-8.299875092923166e-05,
-0.001784191694247801,
-0.027396621999692457]],
即使我能够对整个图像进行失真处理,为了优化相机处理时间,如果我只对角点(图像的红点)进行失真处理:
distorted_border_points = np.array([[[584,1415],
[576,457],
[1956,415],
[1996,1422],
[1261,242],
[1281,1594]]],np.float32)
undistorted_points = cv2.undistortPoints(distorted_border_points, optic_camera_matrix, distorsion_coeffs)
我得到这个回报:
[[[ -6.40190065e-01 1.66883194e+00]
[ -4.87006754e-01 -2.88225353e-01]
[ -1.82562262e-01 3.74070629e-02]
[ -5.28450182e-04 -3.51850584e-04]
[ 8.09574544e-01 -8.40054870e-01]
[ -5.28259724e-02 -1.22379906e-01]]]
如果绘制,它们不会像第一张图像那样在矩形中对齐。
我相信不失真系数计算得很好(因为不失真适用于第一张图像)
如果anyoce 能帮助我解决问题,我将不胜感激。谢谢!
相关分类