fcheng00 / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 1 forks source link

Cannot recognize text if lines of text are rotated #1212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Find an image that produces good OCR output in tesseract
2. Rotate it by a few degrees in the GIMP, so a horizontal line passes through 
2 lines of text
3. Run it through tesseract again

What is the expected output? What do you see instead?

Tesseract says "Empty page!" or outputs only a small amount of the text that's 
separated from the rest

Instead, it should automatically recognize the rotation of the text and rotate 
it to the correct orientation internally before OCR.

What version of the product are you using? On what operating system?

3.02.02 Windows

Please provide any additional information below.

Orientation of text can be automatically detected by running a Radon transform 
on it and then finding the angle with the largest RMS value, which will be the 
orientation at which the transform is "looking down" the rows of text, with 
dark parts alternating with pure white parts.

Original issue reported on code.google.com by omegat...@gmail.com on 24 May 2014 at 12:34

GoogleCodeExporter commented 9 years ago
Example: https://gist.github.com/endolith/334196bac1cac45a4893

Original comment by omegat...@gmail.com on 24 May 2014 at 1:55

GoogleCodeExporter commented 9 years ago
You should be fix rotation[1] if you need it.
[1] https://code.google.com/p/tesseract-ocr/wiki/ImproveQuality

Original comment by zde...@gmail.com on 24 May 2014 at 1:40

GoogleCodeExporter commented 9 years ago
The program should automatically correct rotation.  It shouldn't require that 
every user rotate images manually, or implement their own automatic rotation. 
It should be built into the OCR.

Original comment by omegat...@gmail.com on 24 May 2014 at 1:47

GoogleCodeExporter commented 9 years ago
Leptonica's pixFindSkewAndDeskew() looks like a good solution, too.  It should 
be used by default.

Original comment by omegat...@gmail.com on 24 May 2014 at 1:56

GoogleCodeExporter commented 9 years ago
There are also other preferences and scenarios (two pages scan where each page 
has different skew) where automatic correct does not make sense.

Original comment by zde...@gmail.com on 24 May 2014 at 2:12