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]
评论列表
文章目录