def __init__(self, threshold_func: FilterFunction, game_object, area_scalar=1.0, contour_min_area=0.0, contours_process=EMPTY_PIPELINE): ObjectFinder.__init__(self, game_object, area_scalar=area_scalar) self._full_pipeline = (EMPTY_PIPELINE + threshold_func + find_contours + FilterContours(min_area=contour_min_area) + contours_process)
def __init__(self, threshold_func, game_object, contour_min_area=0): """ initializes the finder :param contour_min_area: the minimal area of a contour, used for FilterContours, default is 0 (no area limit) """ ObjectFinder.__init__(self, threshold_func, game_object) self._full_pipeline = (EMPTY_PIPELINE + threshold_func + find_contours + FilterContours(min_area=contour_min_area) + contours_to_circles_sorted + filter_inner_circles)
def __init__(self, threshold_func, game_object, area_scalar=1.0, contour_min_area=3.0): """ :param area_scalar: optional, a scalar to multiply the area by, for fine tuning of the function's output :param contour_min_area: the minimal area of a contour, used for FilterContours, default is 0 (no area limit) """ ObjectFinder.__init__(self, threshold_func, game_object) self._full_pipeline = (EMPTY_PIPELINE + threshold_func + find_contours + FilterContours(min_area=contour_min_area) + sort_contours + contours_to_rotated_rects_sorted + filter_inner_rotated_rects) self.area_scalar = area_scalar
def __init__(self, threshold_func, game_object, vt_distance=0.2866, enclosing_rect_ratio=0.549, contour_min_area=0): """ initializes the finder :param vt_distance: the distance between the centers of both vision targets :param enclosing_rect_ratio: the ratio between the width and height of the parallel enclosing rect of the vision target :param contour_min_area: the minimal area of a contour, used in FilterContours """ ObjectFinder.__init__(self, threshold_func, game_object) self._full_pipeline = (EMPTY_PIPELINE + threshold_func + find_contours + FilterContours(min_area=contour_min_area) + sort_contours) self.__vector_distance = np.array([vt_distance / 2, 0, 0]) self.vt_distance = vt_distance self.enclosing_rect_ratio = enclosing_rect_ratio