Skip to content

Commit

Permalink
Merge pull request #80 from Kohulan/lower-threshold
Browse files Browse the repository at this point in the history
fix: smaller threshold for definition of long vertical or horizontal lines
  • Loading branch information
OBrink authored Sep 18, 2023
2 parents 78b5bbe + 3f76e22 commit 09358f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions decimer_segmentation/complete_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand All @@ -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)
)
Expand Down

0 comments on commit 09358f1

Please # to comment.