def transform_pose(self, pose): pose_rot = quat2rotmat(pose[3:]) pose_trans = xyz2mat(pose[:3]) pose_cam = self.V.dot(pose_trans.T).dot(pose_rot).T return np.concatenate( [mat2xyz(pose_cam), safemat2quat(pose_cam[:3, :3].T)])
def get_poses(self): mat = [ self.V.dot(self.poses_trans[i].T).dot(self.poses_rot[i]).T for i in range(self.get_num_instances()) ] poses = [ np.concatenate([mat2xyz(item), safemat2quat(item[:3, :3].T)]) for item in mat ] return poses