Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: smaller threshold for definition of long vertical or horizontal lines #80

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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