Tesseract OSD upsidedown images

864 views
Skip to first unread message

Mauro Nonnis

unread,
Jun 13, 2014, 1:35:28 PM6/13/14
to tesser...@googlegroups.com

I notice a wrong behavoir of tesseract when i try to make OSD directly from the executable with images like this: http://imageshack.com/a/img820/3735/uw6l.png
In such case the result is: "OSD: Weak margin (5.85), horiz textlines, not CJK: Don't rotate." which is obviously wrong.
According to me Tesseract get wrong when the image hasn't significant difference between left and right margin.

Is this a know problem or I'm a bit confused?








Paul Vorbach

unread,
Jun 14, 2014, 9:39:23 AM6/14/14
to tesser...@googlegroups.com
I guess it would be very hard to get this kind of error. As far as I know, Tesseract tries to get the angle at which the page has been rotated by finding text lines and measuring their angle. The angle of the text lines in your example seems okay, so it doesn't rotate.

Tom Powers

unread,
Jun 15, 2014, 2:20:54 AM6/15/14
to tesseract-dev
​I don't know how Tesseract handles OSD, but I figured I could try Leptonica's flipdetect_reg [1] on your file by doing:

   flipdetect_reg.exe "flipdetecttest uw6l.png"

And got:

   Test orientation detection
   Time for rop orient test:   0.031 sec
   Error in makeOrientDecision: not enough conf to get orientation
   Time for dwa orient test:   0.016 sec
   ****************************************************
   ***********   Orient results identical   ***********
   ****************************************************
   upconf =   0.000, leftconf =   0.000

   Test orient detection for 4 orientations
   Error in makeOrientDecision: not enough conf to get orientation
   Error in makeOrientDecision: not enough conf to get orientation
   Error in makeOrientDecision: not enough conf to get orientation
   Error in makeOrientDecision: not enough conf to get orientation

   Test mirror reverse detection
   nright = 12.000000, nleft = 31.000000
   Time for rop mirror flip test:   0.047 sec
   Time for dwa mirror flip test:   0.000 sec
   ****************************************************
   ***********   Mirror results identical   ***********
   ****************************************************
   conf =   0.000

   Safer version of up-down tests
   nup =  25.000, ndown =  27.000, conf =   0.000
   nup =  25.000, ndown =  27.000, conf =   0.000
   Confidence results are identical

Which would seem to suggest that there isn't enough data to tell. See "Identifying document image skew and orientation" [2] from Leptonica's "Selected Papers on Image Processing and Image Analysis" page [3] for more details on how flipdetect works. I gather what Tesseract does is more complicated than this though?

[1] http://tpgit.github.io/Leptonica/flipdetect__reg_8c_source.html

[2] http://leptonica.com/papers/skew-measurement.pdf

[3] http://tpgit.github.io/UnOfficialLeptDocs/leptonica/recent-pubs.html

Reply all
Reply to author
Forward
0 new messages