def reconstruct(self, theta): from .algorithms import reconstruct i = 0 j = 1 theta_tensor = get_theta_tensor(theta, self.corners, self.N) Pi = self.points[i, :] Pj = self.points[j, :] k = 2 Pk = self.points[k, :] reconstruction = reconstruct(Pi, Pj, i, j, theta_tensor, Pk, k) return reconstruction
def reconstruct_from_inner_angles(self, theta): from .algorithms import reconstruct_from_inner_angles from .algorithms import procrustes theta_tensor = get_theta_tensor(theta, self.corners, self.N) reconstruction = reconstruct_from_inner_angles( self.points[0, :], self.points[1, :], self.abs_angles[0, 2], self.abs_angles[1, 2], theta_tensor) new_points, __, __, __ = procrustes( self.points, reconstruction.points, scale=True) reconstruction.points = new_points reconstruction.init() return reconstruction
def reconstruct_aloc(self, theta): from pylocus.algorithms import reconstruct_aloc from pylocus.basics_angles import get_theta_tensor theta_tensor = get_theta_tensor(self.theta, self.corners, self.N) i = 0 j = 1 Pi = self.points[i, :] Pj = self.points[j, :] k = 2 Pk = self.points[k, :] reconstruction = reconstruct_aloc(Pi, Pj, i, j, theta_tensor, Pk, k) return reconstruction
def reconstruct_theta(theta, corners, N): """ Given a theta vector, do simple build-up algorithm to generate point set and reconstructed theta. :param theta: vector of M angles :param corners: corresponding corners :param N: number of points :return: vector of M reconstructed angles, point set in canonical shape. """ theta_tensor = get_theta_tensor(theta, corners, N) points_sine = reconstruct_from_angles(theta_tensor) theta_recon, c = create_theta(points_sine) return theta_recon, points_sine
def get_theta_tensor(self): from pylocus.basics_angles import get_theta_tensor self.theta_tensor = get_theta_tensor(self.theta, self.corners, self.N) return self.theta_tensor
def init(self): PointSet.init(self) self.theta, self.corners = create_theta(self.points) self.theta_tensor = get_theta_tensor(self.theta, self.corners, self.N)