Open wvanrensburg opened 10 months ago
I figured a work around, which means Im suspecting the tesseract orientation code isn't using enough characters to determine the correct orientation. Adding -c min_characters_to_try=200
produces the correct results..
tesseract /path/to/image.png /pah/to/reportout --psm 0 --oem 0 -c min_characters_to_try=200
Page number: 0
Orientation in degrees: 0
Rotate: 0
Orientation confidence: 3.59
Script: Latin
Script confidence: 0.57
If you know in advance that the text is written in a specific language, like English in this case, another thing you can try is to add the parameter -l eng.
I didn't test this on the attached image.
tesseract i4172.png - --psm 0
Page number: 0
Orientation in degrees: 180
Rotate: 180
Orientation confidence: 1.45
Script: Greek
Script confidence: 0.59
and with specifying lang:
tesseract i4172.png - --psm 0 -l eng
Warning, detects only orientation with -l eng
Page number: 0
Orientation in degrees: 0
Rotate: 0
Orientation confidence: 25.67
Script: Latin
Script confidence: 5.48
tesseract i4172.png - --psm 0 -l osd
Page number: 0
Orientation in degrees: 180
Rotate: 180
Orientation confidence: 1.45
Script: Greek
Script confidence: 0.59
tesseract i4172.png - --psm 0 -l osd+eng
Warning, detects only orientation with -l osd+eng
Page number: 0
Orientation in degrees: 180
Rotate: 180
Orientation confidence: 1.45
Script: Greek
Script confidence: 0.59
tesseract i4172.png - --psm 0 -l eng+osd
Warning, detects only orientation with -l eng+osd
Page number: 0
Orientation in degrees: 0
Rotate: 0
Orientation confidence: 25.67
Script: Latin
Script confidence: 5.48
Same problem here, though raise min_characters_to_try did help with the accuracy. Adding language seems not working... it gives 0 degrees to all pics I used no matter whether it's facing? Is there any chance that being able to fine tuning osd.traineddata?
Current Behavior
Trying to get the orientation of an image using
psm 0
, and it's reporting an incorrect orientation angle.Commands Tried:
Output of the osd result:
Image being used:
Expected Behavior
The result should spit out a rotation of zero..
Suggested Fix
N/A
tesseract -v
Operating System
macOS 13 Ventura
Other Operating System
No response
uname -a
No response
Compiler
No response
CPU
No response
Virtualization / Containers
No response
Other Information
No response