def __init__(self, ndarray, basis=None): assert isinstance(ndarray, np.ndarray) assert len(ndarray.shape) is 2, "Not a valid visible" self.ndarray = ndarray if basis: self.coord = basis else: self.coord = Rectangle.from_ndarray(self.ndarray)
def __init__(self, full_color_image, orientation, basis): # Projection(full_color_image, orientation, 0.2).debug() self.img = full_color_image self.projection = BinaryProjection(full_color_image, orientation) self.basis = basis or Rectangle.from_ndarray(full_color_image) self.measurement = full_color_image.shape[orientation]
def reset(self): self.coord = Rectangle.from_ndarray(self.ndarray)