Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Some questions about the textlines annotation process #4

Open
KingRicardo opened this issue Dec 25, 2022 · 5 comments
Open

Some questions about the textlines annotation process #4

KingRicardo opened this issue Dec 25, 2022 · 5 comments

Comments

@KingRicardo
Copy link

Hello hao,
Thanks for your awesome work for document image dewarping.
Could you provide more details about the textlines annotation process? (e.g., the kernel size of binarization and dilation, and the filter rule)

@fh2019ustc
Copy link
Owner

fh2019ustc commented Jan 5, 2023

Hi, I am sorry for the late reply due to my health.
I use the cv2.adaptiveThreshold for binarization as follows,

cv2.adaptiveThreshold(xxx, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV,ADAPTIVE_WINSZ, 25)

Besides, for dilation, the kernel size is 1 * 10 (h * w).

@KingRicardo
Copy link
Author

Thanks for your reply.
Hope you will get well soon :)
I still have some questions about how you get the ADAPTIVE_WINSZ in cv2.adaptiveThreshold, and how to filter out non-textline connected regions?

@fh2019ustc
Copy link
Owner

  ADAPTIVE_WINSZ=35
  width and height are the shape of textline candidate 
  if (width < 30) or (height < 2) or (width < 1.5*height):
      this is not a textline

Hope this helps.

@KingRicardo
Copy link
Author

Thank you for sharing the experiment detail!

@Soongja
Copy link

Soongja commented Jan 10, 2023

@fh2019ustc
I have a question about the localization step of the textlines annotation process.
When creating textline masks, did you fill in all the pixels inside the bounding boxes? Or did you shrink the heights of the bounding boxes so that the textline masks only pass through the middle of the bounding boxes? example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants