camera_utils.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def F(self, other): 
        """
        Compute the fundamental matrix with respect to other camera 
        http://www.robots.ox.ac.uk/~vgg/hzbook/code/vgg_multiview/vgg_F_from_P.m

        The computed fundamental matrix, given by the formula 17.3 (p. 412) in
        Hartley & Zisserman book (2nd ed.).

        Use as: 
            F_10 = poses[0].F(poses[1])
            l_1 = F_10 * x_0

        """

        X1 = self.P[[1,2],:]
        X2 = self.P[[2,0],:]
        X3 = self.P[[0,1],:]
        Y1 = other.P[[1,2],:]
        Y2 = other.P[[2,0],:]
        Y3 = other.P[[0,1],:]

        F = np.float64([
            [det(np.vstack([X1, Y1])), det(np.vstack([X2, Y1])), det(np.vstack([X3, Y1]))],
            [det(np.vstack([X1, Y2])), det(np.vstack([X2, Y2])), det(np.vstack([X3, Y2]))],
            [det(np.vstack([X1, Y3])), det(np.vstack([X2, Y3])), det(np.vstack([X3, Y3]))] 
        ])

        return F #  / F[2,2]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号