def unprojectOpenGL(self, u):
# K, R, t = camera.factor()
# squareProj = np.row_stack((
# camera.P,
# np.array([0,0,0,1], np.float32)
# ))
# invProj = np.linalg.inv(squareProj)
# x = invProj*np.row_stack([np.mat(u).T, [1]])
# x = x[:3]
# u = np.mat(u).T
# x = np.linalg.inv(R)*(np.linalg.inv(K)*u - t)
proj = self.getOpenGlCameraMatrix()
invProj = np.linalg.inv(proj)
x = invProj*np.row_stack([np.mat(u).T, [1]])
x = x[:3] / x[3]
return x
评论列表
文章目录