示例#1
0
    def set_target(self, target):
        if target.n_points < self.target.n_points:

            if target.n_points < self.n_landmarks:
                target = PointCloud(target.points[:self.n_align_lms])
                target = np.dot(np.dot(target.as_vector(), self.pinv_va), self.W)
            else:
                target = PointCloud(target.points[:self.n_landmarks])
                target = np.dot(np.dot(target.as_vector(), self.pinv_v), self.W)

            target = PointCloud(np.reshape(target, (-1, self.n_dims)))

        OrthoPDM.set_target(self, target)
示例#2
0
    def set_target(self, target):
        r"""
        Update this object so that it attempts to recreate the ``new_target``.

        Parameters
        ----------
        new_target : `menpo.shape.PointCloud`
            The new target that this object should try and regenerate.
        """
        if target.n_points == self.n_landmarks:
            # densify target
            target = np.dot(np.dot(target.as_vector(), self.pinv_V), self.W)
            target = PointCloud(np.reshape(target, (-1, self.n_dims)))
        OrthoPDM.set_target(self, target)
示例#3
0
 def set_target(self, target):
     if target.n_points == self.n_landmarks:
         # densify target
         target = np.dot(np.dot(target.as_vector(), self.pinv_V), self.W)
         target = PointCloud(np.reshape(target, (-1, self.n_dims)))
     OrthoPDM.set_target(self, target)
示例#4
0
 def set_target(self, target):
     if target.n_points == self.n_landmarks:
         # densify target
         target = np.dot(np.dot(target.as_vector(), self.pinv_V), self.W)
         target = PointCloud(np.reshape(target, (-1, self.n_dims)))
     OrthoPDM.set_target(self, target)