tesseract-ocr / tesseract

Tesseract Open Source OCR Engine (main repository)
https://tesseract-ocr.github.io/
Apache License 2.0
62.43k stars 9.53k forks source link

Small extra blocks with a single letter gets split off of bigger text blocks #2634

Open hnesk opened 5 years ago

hnesk commented 5 years ago

Environment

Current Behavior:

This page of a book gets recognized perfectly except for „die Sache selbst“ (end of third line), which becomes „die Sache selbst‘ (single quote). The other single quote becomes another block containing only the very small character "C" testcase

I'm sorry I could not provide a cropped test image, but for smaller regions the problem disappears.

I'm calling tesseract with default parameters: tesseract testcase.png - -l deu

When called with psm 6 (single uniform block of text) it works, but I don't want to loose the layout information. tesseract testcase.png - -l deu -psm 6

This is of course a minor bug, but maybe it's also easy to fix. It happens like one time in hundred pages. Sometimes footnote numbers get lost the same way. The problem appears at least with tesseract 4.0 / 4.1 / master and in all oem modes.

Expected Behavior:

tesseract should not split of single chars in extra regions

Suggested Fix:

Maybe padding the recognized blocks a bit?

Mojirade18 commented 3 weeks ago

Hi, I would like to work on this issue. I believe I can help resolve it. Please let me know if there are any specific guidelines or considerations I should keep in mind while working on this.