camera.py 文件源码

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

项目:car-detection 作者: mmetcalfe 项目源码 文件源码
def lookAtTransform(pos, target, up, square=False, camera=False):
    pos = np.array(pos, np.float32)
    target = np.array(target, np.float32)
    up = np.array(up, np.float32)

    # print 'lookAtTransform:'
    dir = target - pos

    R = rotationFromVectors(dir, up, camera=camera)

    # print 'R:', R

    pos = np.matrix(pos).T

    V = np.column_stack((R, -R*pos))

    if square:
        V = np.row_stack((
            V,
            np.array([0,0,0,1], np.float32)
        ))

    return V
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号