From 78a7ace8631a28d29a832707b01a46e246d9d4f7 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Mon, 1 Mar 2021 17:55:05 +0100 Subject: [PATCH] typo: s,hirarchy,hierarchy, --- qurator/eynollah/utils/contour.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qurator/eynollah/utils/contour.py b/qurator/eynollah/utils/contour.py index bf53fcd..980eca3 100644 --- a/qurator/eynollah/utils/contour.py +++ b/qurator/eynollah/utils/contour.py @@ -41,7 +41,7 @@ def get_text_region_boxes_by_given_contours(contours): del contours return boxes, contours_new -def filter_contours_area_of_image(image, contours, hirarchy, max_area, min_area): +def filter_contours_area_of_image(image, contours, hierarchy, max_area, min_area): found_polygons_early = list() jv = 0 for c in contours: @@ -50,12 +50,12 @@ def filter_contours_area_of_image(image, contours, hirarchy, max_area, min_area) polygon = geometry.Polygon([point[0] for point in c]) area = polygon.area - if area >= min_area * np.prod(image.shape[:2]) and area <= max_area * np.prod(image.shape[:2]) and hirarchy[0][jv][3] == -1: # and hirarchy[0][jv][3]==-1 : + if area >= min_area * np.prod(image.shape[:2]) and area <= max_area * np.prod(image.shape[:2]) and hierarchy[0][jv][3] == -1: # and hirarchy[0][jv][3]==-1 : found_polygons_early.append(np.array([[point] for point in polygon.exterior.coords], dtype=np.uint)) jv += 1 return found_polygons_early -def filter_contours_area_of_image_tables(image, contours, hirarchy, max_area, min_area): +def filter_contours_area_of_image_tables(image, contours, hierarchy, max_area, min_area): found_polygons_early = list() jv = 0 @@ -68,8 +68,8 @@ def filter_contours_area_of_image_tables(image, contours, hirarchy, max_area, mi area = polygon.area ##print(np.prod(thresh.shape[:2])) # Check that polygon has area greater than minimal area - # print(hirarchy[0][jv][3],hirarchy ) - if area >= min_area * np.prod(image.shape[:2]) and area <= max_area * np.prod(image.shape[:2]): # and hirarchy[0][jv][3]==-1 : + # print(hierarchy[0][jv][3],hirarchy ) + if area >= min_area * np.prod(image.shape[:2]) and area <= max_area * np.prod(image.shape[:2]): # and hierarchy[0][jv][3]==-1 : # print(c[0][0][1]) found_polygons_early.append(np.array([[point] for point in polygon.exterior.coords], dtype=np.int32)) jv += 1