Open FlorianKordon opened 7 months ago
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?
I tend to side with @FlorianKordon that this is the OCR-D wrapper's responsibility. One could add a few checks prior to https://github.com/OCR-D/ocrd_froc/blob/42f1ce0e369d22948f330148035ff02f9866b806/ocrd_froc/processor.py#L164, skipping and logging a warning if the image is unsuitable. (We do have these checks in other processors, too.)
Applying FROC to text line images that are too small (I didn't quantify the exact threshold) leads to different kinds of issues.
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.