From 3f76e22b618fd5c0350fb9ad73e2538606135280 Mon Sep 17 00:00:00 2001 From: Otto Brinkhaus Date: Mon, 18 Sep 2023 17:08:54 +0200 Subject: [PATCH] fix: smaller threshold for definition of long vertical or horizontal line --- decimer_segmentation/complete_structure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decimer_segmentation/complete_structure.py b/decimer_segmentation/complete_structure.py index 32a0ccf..24ea12f 100644 --- a/decimer_segmentation/complete_structure.py +++ b/decimer_segmentation/complete_structure.py @@ -383,7 +383,7 @@ def detect_horizontal_and_vertical_lines(image: np.ndarray) -> np.ndarray: binarised_im = ~image * 255 binarised_im = binarised_im.astype("uint8") - horizontal_kernel_size = int(binarised_im.shape[1] / 5) + horizontal_kernel_size = int(binarised_im.shape[1] / 7) horizontal_kernel = cv2.getStructuringElement( cv2.MORPH_RECT, (horizontal_kernel_size, 1) ) @@ -392,7 +392,7 @@ def detect_horizontal_and_vertical_lines(image: np.ndarray) -> np.ndarray: ) horizontal_mask = horizontal_mask == 255 - vertical_kernel_size = int(binarised_im.shape[0] / 5) + vertical_kernel_size = int(binarised_im.shape[0] / 7) vertical_kernel = cv2.getStructuringElement( cv2.MORPH_RECT, (1, vertical_kernel_size) )