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

Missing check for valid size of input images #11

Open
FlorianKordon opened this issue Apr 5, 2024 · 2 comments
Open

Missing check for valid size of input images #11

FlorianKordon opened this issue Apr 5, 2024 · 2 comments

Comments

@FlorianKordon
Copy link

Applying FROC to text line images that are too small (I didn't quantify the exact threshold) leads to different kinds of issues.

  1. Within the NN, the pooling operation can break due to insufficient height/width. image2
  2. ValueError during image resizing with pillow. image

While providing proper image sizes might also be a responsibility of previous processors, an initial check for valid image dimensions before further processing in FROC might make sense.

I've attached two screenshots.

@kba
Copy link
Member

kba commented Apr 9, 2024

Thanks for the report. I only wrote the OCR-D wrapper, this bug seems to be part of the implementation in froc.py, so you probably understand the code better than I do - can you provide a PR?

@bertsky
Copy link
Contributor

bertsky commented Oct 16, 2024

I tend to side with @FlorianKordon that this is the OCR-D wrapper's responsibility. One could add a few checks prior to

self._process_segment(line, line_image)
, skipping and logging a warning if the image is unsuitable. (We do have these checks in other processors, too.)

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