do_adjust.py 文件源码

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

项目:Large-scale-bundle-adjustment-in-scipy 作者: bachmmmar 项目源码 文件源码
def rotate(points, rot_vecs):
    """Rotate points by given rotation vectors.

    Rodrigues' rotation formula is used.
    """
    theta = np.linalg.norm(rot_vecs, axis=1)[:, np.newaxis]
    with np.errstate(invalid='ignore'):
        v = rot_vecs / theta
        v = np.nan_to_num(v)
    dot = np.sum(points * v, axis=1)[:, np.newaxis]
    cos_theta = np.cos(theta)
    sin_theta = np.sin(theta)

    return cos_theta * points + sin_theta * np.cross(v, points) + dot * (1 - cos_theta) * v
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号