From d0b3bb419f2afd98fc0ca8a773ced6975e8f0c63 Mon Sep 17 00:00:00 2001 From: vahidrezanezhad Date: Tue, 10 Feb 2026 14:32:23 +0100 Subject: [PATCH] extracting ocr textline images and text: vertical lines threshold has changed to 1.4 --- src/eynollah/training/extract_line_gt.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/eynollah/training/extract_line_gt.py b/src/eynollah/training/extract_line_gt.py index 58fc253..fe9f60d 100644 --- a/src/eynollah/training/extract_line_gt.py +++ b/src/eynollah/training/extract_line_gt.py @@ -50,6 +50,12 @@ from ..utils import is_image_filename is_flag=True, help="if this parameter set to true, cropped textline images will not be masked with textline contour.", ) +@click.option( + "--exclude_vertical_lines", + "-exv", + is_flag=True, + help="if this parameter set to true, vertical textline images will be excluded.", +) def linegt_cli( image, dir_in, @@ -57,6 +63,7 @@ def linegt_cli( dir_out, pref_of_dataset, do_not_mask_with_textline_contour, + exclude_vertical_lines, ): assert bool(dir_in) ^ bool(image), "Set --dir-in or --image-filename, not both" if dir_in: @@ -100,6 +107,9 @@ def linegt_cli( x, y, w, h = cv2.boundingRect(textline_coords) + if exclude_vertical_lines and h > 2 * w: + continue + total_bb_coordinates.append([x, y, w, h]) img_poly_on_img = np.copy(img)