I am trying hard on generating some probability scores for each
character in a word.
As I am working with handwritten words, it may be useful information.
e.g.,If I give input as "hello" as a handwritten bmp/tif word image
Now I am getting output say, "nollo". (fixed..no alternative
suggestions)
I want to generate an output inthe following probabilistic form (shown
vertically for each character in word):
a(0.01)..b(0.02)....n(0.6) .. ..z(0.01) --> recognized as 'n'
a(0.01)..b(0.02)....o(0.7) .. ..z(0.01) --> recognized as 'o'
a(0.01)..b(0.02)....l(0.6) ... ..z(0.01) --> recognized as 'l'
a(0.01)..b(0.02)....l(0.6) ... ..z(0.01) --> recognized as 'l'
a(0.01)..b(0.02)....o(0.8).. ..z(0.01) --> recognized as 'o'
While working with this problem and studying the code I have found the
following information:
The sequence execution of significant functions through different
programs are as follows (in standard scenario)
TessBaseAPI::TesseractRectUNLV (baseapi.cpp)
TessBaseAPI::Recognize (baseapi.cpp)
recog_all_words (control.cpp)
classify_word_pass1 (control.cpp)
tess_segment_pass1 (tessbox.cpp)
recog_word (tfacepp.cpp)
recog_word_recursive (tfacepp.cpp)
cc_recog (tfacepp.cpp)
chop_word_main (chopper.cpp)
etc...
etc...
Now, this chop_word_main returns CHOICES_LIST..that is a possible list
of words accoding to best scores..
Can anybody help me here, how to get this list..
or the choice values for each character blob ..they are in float..
Generating a separate output file from here may also help me.
I am somehow confused in here..
For each change in a program, shall I have to rebuild the whole
application (takes lot of time).
I am working in VC++.
basu.
#ifndef GRAPHICS_DISABLED
if (display_ratings && string)
print_choices(string, rating);
if (blob_pause)
window_wait(blob_window);
#endif
So you can use this function function print_choices(string, rating);
and get a probabilistic output.
Please Note: I have only used tprinf for printing output to my log
file
A log file listing (along with my backtracking listings) is give below
for reference.
I gave a simple bmp file as input with a handwritten text basu written
in it.
One can easily customize the output from here I suppose.
===================================================================
Tesseract Open Source OCR Engine
tessedit_serial_unlv=0
I am Here in 3rd Else
I am Here in baseapi.cpp
I am Here in control.cpp
control.cpp->classify_word_pass1
tessbox.cpp->tess_segment_pass1
tfacepp.cpp->recog_word
tfacepp.cpp->recog_word_recursive
tface.cpp->cc_recog
chopper.cpp->chop_word_main:
chop_word: |-> b <- 53.66 -7.01| t 61.22
-8.00
chop_word: |-> a <- 40.80 -8.00
chop_word: |-> s <- 27.28 -8.46| o 30.09
-9.33| z 30.40 -9.43| e 36.22 -11.23
chop_word: |-> u <- 46.97 -9.08| w 51.38
-9.93| a 56.72 -10.96
OUTPUT:Best-Choice:basu
OUTPUT:Blob Choices:4
tfacepp.cpp->recog_word
tfacepp.cpp->recog_word_recursive
tface.cpp->cc_recog
chopper.cpp->chop_word_main:
chop_word: |-> b <- 53.66 -7.01| t 61.22
-8.00
chop_word: |-> a <- 40.80 -8.00
chop_word: |-> s <- 27.28 -8.46| o 30.09
-9.33| z 30.40 -9.43| e 36.22 -11.23
chop_word: |-> u <- 46.97 -9.08| w 51.38
-9.93| a 56.72 -10.96
basu
==========================================================================
Hope this will be helpful info for somebody like me..working with
handwritten data and want some kind of probability scores for each
character.
Thanks all,
Basu
> > > basu.- Hide quoted text -
>
> - Show quoted text -
> > > a(0.01)..b(0.02 )....l(0.6) ... ..z(0.01) --> recognized as 'l'
Any thoughts?
On Oct 5, 10:15 am, "Keith Beaumont" <beaumon...@gmail.com> wrote:
> Basu,
> I found this too & some other stuff. Can you explain what the numbers mean?
> I have an awk job that reads some of these results from the log & formats
> them prettily. Let me know if you want a copy.
> KB
>
chop_word: |-> a <- 40.80 -8.00
There are two numbers associated with each character, the first one is
'rating' and the next one is 'certainty'.
Higher the certainty value in negetive scale, more certain is
Tesseract on its label.
Same for 'rating' higher is the value, more accurate is its label ???
I have some confusion in here..
It appears the characters are ordered based on their Certainty
values..
For my work, I want only one probabilistic measure for each character
or its possibilities..
So, I have used only the certainty metric..(till now)
Following is a part of my output from Tesseract..one character (or its
possibilities) in each row, for each word
c 0.500691 e 0.499309
c 0.500013 o 0.499987
n 0.334020 u 0.333551 w 0.332430
v 1.000000
e 0.334936 t 0.334708 o 0.330356
r 0.500656 n 0.499344
t 1.000000
s 1.000000
The original handwritten word was "converts".
As you can see, now the row wise sum of probabilities is 1.
Tesseract appears to be very certain on some character shapes (v,t,s).
I am still searching for differnt tuning parameters..
GLEN, can you give me your comments on the last line..
I mean what are the parameters to loosen up the matching process..
What are the 'ratings'?..is it OK if I use only the 'CERTAINTY' value,
ignoring 'rating'?
Basu.
> > > > - Show quoted text -- Hide quoted text -
> > > - 9.93| a 56.72 -10.96
> > > chopper.cpp - >chop_word_main:
> > > > > > e.g .,If I give input as "hello" as a handwritten bmp/tif word image
> > > > > > Now I am getting output say, "nollo". (fixed..no alternative
> > > > > > suggestions)
> > > > > > I want to generate an output inthe following probabilistic form
> > > (shown
> > > > > > vertically for each character in word):
> > > > > > a( 0.01)..b(0.02)....n(0.6) .. ..z(0.01) --> recognized as 'n'
> > > > > > a(0.01)..b(0.02)....o(0.7) .. ..z(0.01) --> recognized as 'o'
> > > > > > a(0.01 )..b(0.02)....l(0.6) ... ..z(0.01) --> recognized as 'l'
> > > > > > a(0.01)..b(0.02)....l(0.6) ... ..z(0.01) --> recognized as 'l'
> > > > > > a(0.01 )..b(0.02)....o(0.8).. ..z(0.01) --> recognized as 'o'
> > > > > > a( 0.01 )..b(0.02)....l(0.6) ... ..z(0.01) --> recognized as 'l'
Some people want speed especially for hidden text pdf.
> On 10/10/07, Keith Beaumont <beaumon...@gmail.com> wrote:
>
>
>
> > Basu,
> > Here's a small debug sample. Files are:
> > tess in: do1.tif
> > tess out log: do1_dbg2
> > awk job: awk_tess_dbg2
> > awk job out: do1_dbg2_out.txt
>
> > Some of it comes from the verbose code provided by Fil's Hacker's Guide &
> > some from setting debug flags. I can't remember exactly which flags I set to
> > get all of this. I have to re-visit it soon. Currently side-tracked by the
> > starbase code.
> > If you can explain the meanings of any of the output, that would be
> > useful.
> > KB
>
> > On 10/9/07, Keith Beaumont <beaumon...@gmail.com> wrote:
>
> > > Basu,
> > > I'll try & send my stuff soon. Currently busy looking at the starbase
> > > output.
> > > KB
>
> > > > > > > > > > a(0.01 )..b(0.02)....l(0.6) ... ..z(0.01) -->
> > > > recognized as 'l'
> > > > > > > > > > a(0.01)..b(0.02)....l(0.6) ... ..z(0.01) -->
> > > > recognized as 'l'
> > > > > > > > > > a(0.01 )..b(0.02)....o(0.8).. ..z(0.01) -->
> > > > recognized as 'o'
>
> > > > > > > > > > While working with this problem and studying the code I
> > > > have found
> > > > > > > the
> > > > > > > > > > following information:
> > > > > > > > > > The sequence execution of significant functions through
> > > > different
> > > > > > > > > > programs are as follows (in
>
> ...
>
> read more »
THANKS for you tip on configs..
Its working great for me..
Its a value addition for me..
I didnot know how to use these configs..
I am not using the DLL right now..
But still some confusion on Certainty and Ratings values..
For example, the handwritten word 'attesting' gave the following
result in (Character,Rating,Certainty) format
a 16.371164 -2.538165
t 18.585669 -4.589054 c 27.228859 -6.723175 e
28.481579 -7.032489
t 16.506004 -4.152454 e 26.314919 -6.620106 c
27.497448 -6.917597
e 17.168756 -3.135846
s 16.620825 -2.841166 z 32.940907 -5.630924
t 23.237991 -5.251523
i 9.632350 -5.351305 l 12.125552 -6.736418
n 11.628005 -2.627798
g 30.566916 -3.396324
One can observe, higher is the Certainty(-ve scale), lower is the
Rating!!!
Are these charaters ordered on lower Rating value or higher Certainty
values..
As for my observation..they are ordered on Certainty..AM I CORRECT?
That means, is it good to have lowest Rating for a character/word???
Confused..it appears from code that high rating is good..but I am
getting different result..
I need to construc a single probability score from here..
Now, I discarded Ratings and using only Certainty and got the
following:
a 1.000000
t 0.338751 c 0.331174 e 0.330076
t 0.339512 e 0.330771 c 0.329717
e 1.000000
s 0.507283 z 0.492717
t 1.000000
i 0.503686 l 0.496314
n 1.000000
g 1.000000
ANY misinterpretation of Tesseract Findings here?
Please suggest..
Basu.
> On 10/10/07, Keith Beaumont <beaumon...@gmail.com> wrote:
>
>
>
>
>
> > Basu,
> > Here's a small debug sample. Files are:
> > tess in: do1.tif
> > tess out log: do1_dbg2
> > awk job: awk_tess_dbg2
> > awk job out: do1_dbg2_out.txt
>
> > Some of it comes from the verbose code provided by Fil's Hacker's Guide &
> > some from setting debug flags. I can't remember exactly which flags I set to
> > get all of this. I have to re-visit it soon. Currently side-tracked by the
> > starbase code.
> > If you can explain the meanings of any of the output, that would be
> > useful.
> > KB
>
> > On 10/9/07, Keith Beaumont <beaumon...@gmail.com> wrote:
>
> > > Basu,
> > > I'll try & send my stuff soon. Currently busy looking at the starbase
> > > output.
> > > KB
>
> > > > > > > > > > a(0.01 )..b(0.02)....l(0.6) ... ..z(0.01) -->
> > > > recognized as 'l'
> > > > > > > > > > a(0.01)..b(0.02)....l(0.6) ... ..z(0.01) -->
> > > > recognized as 'l'
> > > > > > > > > > a(0.01 )..b(0.02)....o(0.8).. ..z(0.01) -->
> > > > recognized as 'o'
>
> > > > > > > > > > While working with this problem and studying the code I
> > > > have found
> > > > > > > the
> > > > > > > > > > following information:
> > > > > > > > > > The sequence execution of significant functions through
> > > > different
> > > > > > > > > > programs are as follows (in
>
> ...
>
> read more »- Hide quoted text -
On Oct 10, 11:20 pm, "Keith Beaumont" <beaumon...@gmail.com> wrote:
> Basu,
> Here's a small debug sample. Files are:
> tess in: do1.tif
> tess out log: do1_dbg2
> awk job: awk_tess_dbg2
> awk job out: do1_dbg2_out.txt
>
> Some of it comes from the verbose code provided by Fil's Hacker's Guide &
> some from setting debug flags. I can't remember exactly which flags I set to
> get all of this. I have to re-visit it soon. Currently side-tracked by the
> starbase code.
> If you can explain the meanings of any of the output, that would be useful.
> KB
>
> On 10/9/07, Keith Beaumont <beaumon...@gmail.com> wrote:
>
>
>
>
>
> > Basu,
> > I'll try & send my stuff soon. Currently busy looking at the starbase
> > output.
> > KB
>
> > > > > > > > > e.g.,If I give input as "hello" as a handwritten bmp/tif
> > > word image
> > > > > > > > > Now I am getting output say, "nollo". (fixed..no alternative
>
> > > > > > > > > suggestions)
> > > > > > > > > I want to generate an output inthe following probabilistic
> > > form
> > > > > > (shown
> > > > > > > > > vertically for each character in word):
> > > > > > > > > a(0.01)..b(0.02)....n(0.6) .. ..z(0.01) --> recognized
> > > as 'n'
> > > > > > > > > a(0.01)..b(0.02)....o(0.7) .. ..z(0.01) --> recognized
> > > as 'o'
> > > > > > > > > a(0.01)..b(0.02)....l(0.6) ... ..z(0.01) --> recognized
> > > as 'l'
> > > > > > > > > a(0.01)..b(0.02)....l(0.6) ... ..z(0.01) --> recognized
> > > as 'l'
> > > > > > > > > a(0.01)..b(0.02)....o(0.8).. ..z(0.01) --> recognized
> basu.zip
> 6KDownload- Hide quoted text -
> ...
>
> read more »- Hide quoted text -
> > > > > > > > -9.33| z 30.40 - 9.43| e 36.22 -11.23
> > > > > > > > chop_word: |-> u <- 46.97 -9.08| w
> > > > > 51.38
> > > > > > > > - 9.93| a 56.72 -10.96
> > > > > > > > OUTPUT:Best-Choice:basu
> > > > > > > > OUTPUT:Blob Choices:4
> > > > > > > > tfacepp.cpp->recog_word
> > > > > > > > tfacepp.cpp->recog_word_recursive
> > > > > > > > tface.cpp->cc_recog
> > > > > > > > chopper.cpp->chop_word_main:
> > > > > > > > chop_word: |-> b <- 53.66 -7.01| t
> > > > > 61.22
> > > > > > > > -8.00
> > > > > > > > chop_word: |-> a <- 40.80 -8.00
> > > > > > > > chop_word: |-> s <- 27.28 -8.46| o
> > > > > 30.09
> > > > > > > > -9.33| z 30.40 - 9.43| e 36.22 -11.23
> > > > > > > > > > > a( 0.01)..b(0.02)....o(0.7) .. ..z(0.01) --> recognized