【问题标题】:How to project points from undistort image to distort image?如何将未扭曲图像的点投影到扭曲图像?
【发布时间】:2020-01-20 14:52:10
【问题描述】:

我在 cv::fisheye::calibrate 的帮助下对鱼眼镜头图像进行了不失真处理,发现了以下系数。

K = 
array([[541.11407173,   0.        , 659.87320043],
       [  0.        , 541.28079025, 318.68920531],
       [  0.        ,   0.        ,   1.        ]])
D =
array([[-3.91414244e-02],
       [-4.60198728e-03],
       [-3.02912651e-04],
       [ 2.83586453e-05]])

new_K = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(K, D, (1280, 720), np.eye(3), balance=1, new_size=(3400, 1912), fov_scale=1)
map1, map2 = cv2.fisheye.initUndistortRectifyMap(K, D, np.eye(3), new_K, (3400, 1912), cv2.CV_16SC2)
undistorted_img = cv2.remap(distorted_img, map1, map2, interpolation=cv2.INTER_LINEAR, borderMode=cv2.BORDER_CONSTANT)

如何找到 x 和 y ?

【问题讨论】:

    标签: opencv distortion fisheye


    【解决方案1】:
    objp = np.array([[[(1595-new_K[0, 2])/new_K[0, 0], (922-new_K[1, 2])/new_K[1, 1], 0.]]])
    rvec = np.array([[[0., 0., 0.]]])
    tvec = np.array([[[0., 0., 0.]]])
    imgpoints2, _ = cv2.fisheye.projectPoints(objp, rvec, tvec, K, D)
    
    x = imgpoints2[0,0,0]
    y = imgpoints2[0,0,1]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-03-24
      • 2016-01-07
      • 2014-08-13
      • 2016-03-18
      • 2016-01-02
      • 2017-02-12
      • 2013-01-12
      相关资源
      最近更新 更多