Пример #1
0
    def __init__(self, min_coords, max_coords=None, force_valid=False):
        if isinstance(min_coords, Dlt):
            self.dlt_tfm = min_coords
        else:
            if max_coords is None:
                max_coords = min_coords
                min_coords = np.zeros(dim)
            self.dlt_tfm = Dlt(offset=(max_coords + min_coords) / 2,
                               scale=(max_coords - min_coords) / 2)

        if force_valid:
            min_coords = self.min_coords
            max_coords = self.max_coords
            self.dlt_tfm = Dlt(offset=(max_coords + min_coords) / 2,
                               scale=(max_coords - min_coords) / 2)
Пример #2
0
 def mean(self):
     '''Returns the mean vector.'''
     if self._mean is None:
         self._mean = np.zeros(
             self.ndim) if abs(self.m0) < EPSILON else self.m1 / self.m0
     return self._mean
Пример #3
0
 def __init__(self, offset=np.zeros(2), scale=1, angle=0, on=False):
     self.offset = offset
     self.scale = scale
     self.angle = angle
     self.on = on
Пример #4
0
 def __init__(self, offset=np.zeros(2), linear=Lin2d()):
     self.offset = offset
     self.linear = linear
Пример #5
0
 def __init__(self, offset=np.zeros(3), scale=np.ones(3), check_shapes=True):
     self.offset = offset
     self.scale = scale
     if check_shapes:
         _ = self.dim # just to check the shapes
Пример #6
0
 def __init__(self, weight=np.identity(3), bias=np.zeros(3), check_shapes=True):
     self.weight = weight
     self.bias = bias
     if check_shapes:
         _ = self.dim  # just to check shapes
Пример #7
0
 def __init__(self, offset=np.zeros(2), scale=1):
     self.offset = offset
     self.scale = scale
Пример #8
0
 def __init__(self, offset=np.zeros(2), unitary=np.identity(2)):
     self.offset = offset
     self.unitary = unitary