Open rajkumardongre opened 5 days ago
There’s another issue which explains that rotateAuto only works up to +-10 degrees, so indeed it won’t work with text angled at 45 degrees.
I’m not sure if this is something that could be changed or is somehow inherent to the method.
It’s probably a good idea to use another method to detect the text (including position and angle) before feeding it into Tesseract once straightened.
+1 to the issue.
Hey Jacques,
How would you recommend to "detect the text (including position and angle) before feeding it ". Is there a built in function in teserractJs for this or you suggesting to use some other library like OpenCv to accomplish this?
@rajkumardongre I think there are two separate issues here. First is the case of images that are scanned in a particular orientation--one of 0, 90, 180, or 270 degrees. This should be something Tesseract is capable of handling, however appears to be bugged in certain cases. This is already being discussed in #940.
The second issue brought up above is images rotated by some amount that is not a standard orientation, nor an amount close enough to be handled by rotateAuto
. For example, rotation by 45 degrees. Even if all the bugs were patched, this is not something Tesseract supports, so this would require a third-party tool.
I am using Tesseract.js version 5.1.1 to build a simple OCR solution. While it works well on images with horizontally or vertically aligned text (top to bottom), I encounter issues when the text is at an angle or written bottom to up.
Observations:
Text orientation issues:
Settings applied:
rotateAuto: true
, which works in some cases but fails to detect text properly at certain angles.Expected Behavior:
OCR should be able to correctly detect and process text, regardless of its orientation or the angle at which it appears in the image.
Actual Behavior:
Text at an angle or written from bottom to top is either not recognized or inaccurately detected.
Steps to Reproduce:
rotateAuto: true
and enable orientation detection.Additional Information:
Images for Reference:
images of the text where recognition fails