-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Tesseract struggles with 90-degree angled text sometimes #4387
Comments
Oh, wait, now I just realized that I had the orientations the wrong way around: The hOCR spec for The main issue then, seems to be that |
Is |
@amitdo It looks like they are both in the same path, yes:
Let me know if there's any more information you need. For the record, in the repro case I gave above in this issue description, I was using the latest AppImage of Tesseract, version 5.5.0. Not sure if the AppImage itself contains the traineddata or if it uses the system files (which are for an older Tesseract version). Either way, I'm pretty this issue has existed for a long while, I initially did not use the AppImage but rather my system (Ubuntu 22.04 Jammy) version of Tesseract (version 4.1.1). |
I tested it myself with tesseract 5.5.0. I get a similar result. |
Current Behavior
I was investigating whether Tesseract can handle mixed orientation in the text (see also: #2055), and found a specific case where it almost works, but fails in a way that makes me think there's a bug in the code. More specifically, in the example that I provide below, Tesseract seems to be reading the 90-degree text "upside-down", as in, reading the 90-degree text as if though it was 270-degree text.
For example, as you can see in the output hOCR below, the
textangle
is correctly identified as 90 degrees, but Tesseract is reading the text "upside-down", i.e. from a 270 degree perspective. Look at words like "anbeu" ("neque" but upside-down), "luenb" ("quam" but upside-down), "wesdi" ("ipsum" but upside-down) and so on.Command used:
tesseract text-90deg.png text-90deg --psm 1 hocr
Input image:
Output hOCR:
text-90deg.hocr.txt
Tested with the current latest AppImage of Tesseract, 5.5.0
Expected Behavior
Tesseract should read all the text in the correct orientation so that there are no jumbled words in the hOCR output.
Suggested Fix
Find and fix the bug that makes Tesseract read 90-degree text as 270-degree text in this case.
tesseract -v
Operating System
Ubuntu 22.04 Jammy
Other Operating System
No response
uname -a
No response
Compiler
No response
CPU
No response
Virtualization / Containers
No response
Other Information
No response
The text was updated successfully, but these errors were encountered: