[Tesseract 3.0.3] Unexpected result from very simple image

296 views
Skip to first unread message

hou...@jolome.com

unread,
Mar 11, 2014, 2:41:30 AM3/11/14
to tesser...@googlegroups.com
Just made a fresh install of version 3.0.3 and decided to test it out on one the image of this test page http://iupr1.cs.uni-kl.de/~tmb/ocropus-results/g1000p22/ 

Basically, I got better accuracy with 3.0.2 than with 3.0.3 using the default english model.


For the test, I'm using this image (single page) http://iupr1.cs.uni-kl.de/~tmb/ocropus-results/g1000p22/0002.nrm.png

As you can see on the image below, there really isn't any skew or border. Also changed the dpi from 72 to 300




When I run tesseract 3.0.3 on this image using various psm, the most accurate result is :

=========

POPULAR TALES

0'

THE WEST HIGHLANDS.

__._

XVIII.

THE CHEST.
Mlanhanhy.

BEFOREthhthmwnflnglndhewinhed

bloehil son with nwifo bofomhonhould depart
Hinnnnidhehadbeï¬ orgofornwife;mdhognve
himhnlfuhnndmdponndltogothcr. Homtfor-
wudtholengthofuday,lndwhanthonightumoho
mtinblhahlrytomyinit Homtdmtoa
chmbarwithngoodï¬ ninfrontofhim;mdwhenhe
hadgoflenmuhthomofthohouumtdownto
hikme Hobldthomofflnhonnmojour-
noyonwhichhom Thammofthehountold
himhneednotgofuflha; “chasm-little
homoppodbtohhdupingchmhugthtdnmm
ofthohouuhndthmï¬ nodmghmnndifhowonld
undinthewindowofhilchmbuinthomoming,
Mbowouldmonom-noflmooming
hot-alt Thattheymulllihuchothmnnd
hoouldnotdisï¬ ngniahomï¬ omhoï¬ ot,but

voun. n \-

Eii‘

(r.- if-



========

In tesseract 3.0.2, I get a more accurate running the same command:

POPULAR 
THE 
TALES 
WEST HIGHLANDS. 

THE CHEST. 
From In MecGeechy, Ieley. 
B‘i§°.:‘.‘%..:“;:.*::a: .r::..'..‘::"..%..:“.‘.‘..,.':r.18 
llie eon said he had better go for 5 wife ; and he gave 
him lmlf a hundred pounds to get her. He went for- 
wen! the length of is day, and when the night came he 
wentintoehoetelrytoeteyinit. Hewentdowntoe 
chamber with e good fire in front of him; and when he 
bed gotten meet, the men of the house went down to 
telk to him. He told the men of the house the jour- 
no] on which he was The men of the house told 
himheneednot go further; that therewee e little 
house opposite to his sleeping chsmber; that the men 
of the house had three fine daughters; end if he would 
stand in the window of his chamber in the morning, 
that he would see one after enother coming ‘to dreee 
herself. That they were ell like eech other, and that 
In could not one from the other, but that 


zdenko podobny

unread,
Mar 11, 2014, 3:39:06 AM3/11/14
to tesser...@googlegroups.com
Did you think about using some recent version of tesseract ;-) ?
Versions 3.0.2 and 3.0.3 seem too old for me (even I am not aware that they we released). Current stable version is 3.02.02 and next release will be 3.03.

Zdenko


--
--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to tesser...@googlegroups.com
To unsubscribe from this group, send email to
tesseract-oc...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

---
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hou...@jolome.com

unread,
Mar 11, 2014, 4:10:49 AM3/11/14
to tesser...@googlegroups.com
Sorry I typed the version number incorrectly.. I downloaded the most recent version of source code (3.03) from Google Drive actually...

I tested the same image against 3.02 an 3.03
Message has been deleted

Bernard Polarski

unread,
Mar 11, 2014, 6:40:42 AM3/11/14
to tesser...@googlegroups.com

There is too much noise. I reprocessed the image using scantailor:
 
scantailor-cli -v --layout=1.5 --dpi=300 --output-dpi=300 --margins-top=5 --margins-bottom=5 --margins-left=10 --margins-right=10 --threshold=-40 --picture-shape=rectangular --enable-page-detection --white-margins --enable-fine-tuning --color-mode=black_and_white --normalize-illumination=true --despeckle=off --start-filter=3 0002_nrm.png out

 
No panick on this long command: it is my standard scantailor one. With no picture I use '--color-mode=black_and_white'.
With a picture into the image I use '--color=color_grayscale'  followed by an imagemagic "convert $f  -type GrayScale  -normalize   $f"
 
Note the thershold=-40 (negative 40) , this is due to the thick ink in your image. Usually I do -threshold=15  (positive 15).
 
 


 
 
 
Got this translation :
 
/opt/out> ts 0002_nrm.tif a40
Tesseract Open Source OCR Engine v3.03 with Leptonica
/opt/out> cat a40.txt
POPULAR TALES

0'

THE WEST HIGHLANDS.

+

XVIII.

T H E C H E S T.
From Mrs MacGeechy. Inlay.

EFORE this there was a king, and he wished
to see his son with a wife before he should depart.
His son said he had better go for a wife ; and he gave
him half a hundred pounds to get her. He went for-
ward the length of a day, and when the night came he
went in to a hostelry to stay in it. He went down to a
chamber with a good fire in front of him; and when he
had gotten meet. the man of the house went down to
talk to him. He told the man of the house the jour-
ney on which he was The man of the house told
him he need not go further; that there was a little
house opposite to his sleeping chamber; that the man
of the house had three fine daughters ; and if he would


stand in the window of his chamber in the morning,

that he would see one after mother coming \0 dress
herself. That they were all like each other, and that
he could not  one from the other. but that
v01. IL n -

\

Note that in the word 'fire' and  'fine' there is a sign 'fi' whch is in fact a single character and is a pleague in the unicharset 
I added this rule in my FRA module in unicharambigs to get rid of it:
 
1       fi       2       f       i       1
1       fl       2       f       l       1

You will note that I put 1 at last --> mendatory replace.
 
Who introduced these two signs and why, I don't know but they are extremly domageable.

Bernard Polarski

unread,
Mar 11, 2014, 7:31:30 AM3/11/14
to tesser...@googlegroups.com

With --threshold=-42 we have a near miss 100%. ( 98¨% ?)
The funny thing is that with -45 tesseract resolves the broken 'to' correctly but  we start to see regressions.
the word 'another' is incorrectly set to 'mother' at -42 and correctly set at -45.
 
In Both case the first B is correctly resolved and this is amazing.
 
So if it is a full book you have probably your right scantailor setting.
 
/opt/out> sdiff a42.txt a45.txt
POPULAR TALES                                                   POPULAR TALES
0'                                                            | OF
THE WEST HIGHLANDS.                                             THE WEST HIGHLANDS.
+                                                               +
XVIII.                                                          XVIII.
T H E C H E S T.                                                T H E C H E S T.
From Mrs MacGeaehy. lslsy.                                    | From Mrs MacGeeehy, lslsy.
BEFORE this there was a king, and he wished                     BEFORE this there was a king, and he wished
to see his son with n wifo before he should deport            | to see his son with n wife before he should dqqu
His son said he had better go for a wife ; and he gave        | His son said he had better go for a wife; and he gave
him half a hundred pounds to get her. He went for-              him half a hundred pounds to get her. He went for-
ward the length of a day, and when the night came he            ward the length of a day, and when the night came he
went in to a hostelry to stay in it. He went down to a        | went in to a hostelry to stay in it He went down to a
chamber with a good fire in front of him; and when he            chamber with a good fire in front of him; and when he
had gotten meat, the man of the house went down to            | hm! gotten meat, the men of the house went down to
talk to him. He told the man of the house the jour-             talk to him. He told the man of the house the jour-
ney on which he was The man of the house told                   ney on which he was The man of the house told
him he need not go further; that there was a little             him he need not go further; that there was a little
house opposite to his sleeping chamber ; that the man           house opposite to his sleeping chamber ; that the man
of the house had three fine daughters ; and if he would          of the house had three fine daughters ; and if he would
stand in the window of his chamber in the morning,              stand in the window of his chamber in the morning,
that he would see one after mother coming ‘0 dress            | that he would see one after another coming to dress
herself. That they were all like each other, and that           herself. That they were all like each other, and that
he could not distinguish one from the other, but that           he could not distinguish one from the other, but that
v01. IL 3 -                                                   | 101. IL a -
\                                                               \
 

Olalekan Houdan ABOU BAKAR

unread,
Mar 11, 2014, 10:20:46 PM3/11/14
to tesser...@googlegroups.com
Thanks Bernard for the answers. I was comparing boths versions of Tesseract with no intial pre-processing...I seem to be the only one with the issue, so there has to be somewhere.

I did get better results than the one I posted as well after processing the image with unpaper. I'll compare with the scantailor settings you posted. 

Cheers!



--
Reply all
Reply to author
Forward
0 new messages