-cl: also filter textregions without textlines here

This commit is contained in:
Robert Sachunsky 2026-04-21 21:21:32 +02:00
parent 4a6d3968f9
commit fa8340dbb4

View file

@ -2502,11 +2502,6 @@ class Eynollah:
all_found_textline_polygons, None, None, type_contour="textline")
all_found_textline_polygons_marginals = dilate_textline_contours(
all_found_textline_polygons_marginals)
polygons_of_textregions, all_found_textline_polygons, \
polygons_of_textregions_d, conf_textregions = \
self.filter_contours_without_textline_inside(
polygons_of_textregions, all_found_textline_polygons,
polygons_of_textregions_d, conf_textregions)
else:
scale_param = 1
textline_mask_tot_ea_erode = cv2.erode(textline_mask_tot_ea, kernel=KERNEL, iterations=2)
@ -2524,6 +2519,11 @@ class Eynollah:
num_col_classifier, scale_param, slope_deskew, image['name'])
all_found_textline_polygons_marginals = small_textlines_to_parent_adherence2(
all_found_textline_polygons_marginals, textline_mask_tot_ea, num_col_classifier)
(polygons_of_textregions, all_found_textline_polygons,
polygons_of_textregions_d, conf_textregions) = \
self.filter_contours_without_textline_inside(
polygons_of_textregions, all_found_textline_polygons,
polygons_of_textregions_d, conf_textregions)
(polygons_of_marginals_left,
polygons_of_marginals_right,