camera_utils.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def sampson_error(F, pts1, pts2): 
    """
    Computes the sampson error for F, and points pts1, pts2. Sampson
    error is the first order approximation to the geometric error.
    Remember that this is a squared error.

    (x'^{T} * F * x)^2
    -----------------
    (F * x)_1^2 + (F * x)_2^2 + (F^T * x')_1^2 + (F^T * x')_2^2

    where (F * x)_i^2 is the square of the i-th entry of the vector Fx
    """
    x1, x2 = unproject_points(pts1).T, unproject_points(pts2).T
    Fx1 = np.dot(F, x1)
    Fx2 = np.dot(F, x2)

    # Sampson distance as error measure
    denom = Fx1[0]**2 + Fx1[1]**2 + Fx2[0]**2 + Fx2[1]**2
    return ( np.diag(x1.T.dot(Fx2)) )**2 / denom
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号