rectify.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Smart-Car 作者: jimchenhub 项目源码 文件源码
def rectify(mtx1, dist1, mtx2, dist2, R, T):
    # R????????????P?3*4????????Q?4*4??????
    R1, R2, P1, P2, Q, roi1, roi2 = cv2.stereoRectify(
        mtx1, dist1,
        mtx2, dist2,
        (BINIMG_W, BINIMG_H),
        R,
        T,
        flags=cv2.CALIB_ZERO_DISPARITY,
        alpha=-1,
        newImageSize=(BINIMG_W, BINIMG_H)
    )
    if __name__ == '__main__':
        printMat(R1, R2, P1, P2, Q, roi1, roi2)
    # ??????????????mapx, mapy?
    mapx1, mapy1 = cv2.initUndistortRectifyMap(
        mtx1, dist1,
        R1, P1,
        (BINIMG_W, BINIMG_H),
        cv2.CV_16SC2
    )
    mapx2, mapy2 = cv2.initUndistortRectifyMap(
        mtx2, dist2,
        R2, P2,
        (BINIMG_W, BINIMG_H),
        cv2.CV_16SC2
    )
    return mapx1, mapy1, mapx2, mapy2, Q, roi1, roi2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号