mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-09 20:29:55 +02:00
remove unused filter_contours_area_of_image_interiors
This commit is contained in:
parent
e2ae6dbd44
commit
35838069fc
3 changed files with 19 additions and 29 deletions
|
@ -56,23 +56,6 @@ def filter_contours_area_of_image(image, contours, hirarchy, max_area, min_area)
|
|||
jv += 1
|
||||
return found_polygons_early
|
||||
|
||||
def filter_contours_area_of_image_interiors(image, contours, hirarchy, max_area, min_area):
|
||||
found_polygons_early = list()
|
||||
|
||||
jv = 0
|
||||
for c in contours:
|
||||
if len(c) < 3: # A polygon cannot have less than 3 points
|
||||
continue
|
||||
|
||||
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:
|
||||
# print(c[0][0][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):
|
||||
found_polygons_early = list()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue