-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
PDF renderer: Tesseract inserts spaces for non-text blocks it finds #3957
Comments
Please post hocr output. |
hocr file created like this; tesseract.exe "C:\Tesseract\v.png" "c:\tesseract\v" --tessdata-dir "C:\Tesseract\tessdata_best-main" -l dan --psm 4 --oem 1 -c tessedit_create_hocr=1 Let me know if these parameters at not correct, thanks. |
Tesseract see this as a photo + a few line separators. The hocr renderer correctly drops the spaces. The pdf renderer should ignore any non-text blocks. |
Related PR: #3723. |
See the fixed pdf output here: |
Environment
Current Behavior:
Spaces are found by Tesseract and inserted in output PDF. It seems to be confused by the horizontal lines in the attached image.
I use this PDF to overlay on top of another PDF which already contains text, and this causes problems in the resulting PDF due to intersections.
Expected Behavior:
Tesseract finding standalone spaces does not make sense to me. I would expect Tesseract to only find characters in the logo and disregard the lines. At least the lines should be underscores or something - not spaces.
Suggested Fix:
Unsure if problem should be fixed in Tesseract or if the spaces should be filtered in the PDF renderer. I think Tesseract as it will fix all output formats.
The text was updated successfully, but these errors were encountered: