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

Horizontal vertical line exclusion #77

Merged
merged 7 commits into from
Sep 18, 2023

Conversation

OBrink
Copy link
Collaborator

@OBrink OBrink commented Sep 18, 2023

In order to make the mask expansion a bit more "intelligent" and to avoid that it includes complete tables, I have implemented a very straightforward algorithm:

  1. Detect vertical and horizontal lines, that have a length of >= 20% of the image height/width in the dilated image and create a binary mask ("exclusion mask") to label the pixels that belong to these lines.
  2. During the mask expansion: Whenever a pixel is in question to be treated as a new seed pixel: Check if it is labelled in the exclusion mask.
    2a) If labelled in the exclusion mask, do not consider it a new seed pixel.
    2b) If not labelled in the exclusion mask: Proceed as usual (add it to the seed pixel list)

This is simple, fast and effective to avoid whole tables being included in the masks because they touch a chemical structure depiction in the dilated image.

@OBrink OBrink added the enhancement New feature or request label Sep 18, 2023
@OBrink OBrink requested a review from Kohulan September 18, 2023 13:53
@Kohulan Kohulan merged commit e79457a into master Sep 18, 2023
@OBrink OBrink deleted the horizontal_vertical_line_exclusion branch September 21, 2023 12:33
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants