def world2image_uvMat(self, uv_mat):
'''
@param XYZ_mat: is a 4 or 3 times n matrix
'''
if uv_mat.shape[0] == 2:
if len(uv_mat.shape)==1:
uv_mat = uv_mat.reshape(uv_mat.shape + (1,))
uv_mat = np.vstack((uv_mat, np.ones((1, uv_mat.shape[1]), uv_mat.dtype)))
result = np.dot(self.Tr33, uv_mat)
#w0 = -(uv_mat[0]* self.Tr_inv_33[1,0]+ uv_mat[1]* self.Tr_inv[1,1])/self.Tr_inv[1,2]
resultB = np.broadcast_arrays(result, result[-1,:])
return resultB[0] / resultB[1]
评论列表
文章目录