Mmhh.. I'm working on stable version, not SVN => no AdaptToWordStr()
in baseapi.cpp

in ccmain/tfacepp.cpp, there is:

 Tesseract::recog_word_recursive(
     WERD *word,                            // word to do
     DENORM *denorm,                        // de-normaliser
     POLY_MATCHER matcher,                  // matcher function
<----------
     POLY_TESTER tester,                    // tester function
<----------
     POLY_TESTER trainer,                   // trainer function
<----------
     BOOL8 testing,                         // true if answer driven
<-------
     WERD_CHOICE *&raw_choice,              // raw result
     BLOB_CHOICE_LIST_CLIST *blob_choices,  // list of blob lists
     WERD *&outword                         // bln word output
     )

inside of which there is the definition for tess_tester and
tess_trainer:

   tess_tester = testing ? tester : NULL;
   tess_trainer = testing ? trainer : NULL;

but then, those tess_* aren't used at all. The only function I was
able to find is call_train_tester, but it's never called (and marked
as deadcode):

 /
**********************************************************************
  * call_train_tester
  *
  * Called from Tess with a blob in tess form.
  * Convert the blob to editor form.
  * Call the trainer setup by the segmenter in tess_trainer.
 
**********************************************************************/
 #if 0  // dead code
 void call_train_tester(                     //call a tester
                        const STRING& filename,
                        TBLOB *tessblob,     //blob to test
                        BOOL8 correct_blob,  //true if good
                        char *text,          //source text
                        inT32 count,         //chars in text
                        LIST result          //output of matcher
                       ) {
   PBLOB *blob;                   //converted blob
   BLOB_CHOICE_LIST ratings;      //matcher result

   blob = make_ed_blob (tessblob);//convert blob
   if (blob == NULL)
     return;
                                  //make it right type
   convert_choice_list(result, ratings);
   if (tess_trainer != NULL)
     (*tess_trainer) (filename, blob, tess_denorm, correct_blob, text,
count, &ratings);
   delete blob;                   //don't need that now
 }
 #endif

BTW, we reach the function following those steps ("--" means unuseful
for us):

...
recog_all_words(--, --, --, --);
 classify_word_pass2(--, --, --);
  match_word_pass2(--,--, --, --);
   correct_segment_pass2( -- , -- , &Tesseract::tess_default_matcher,
tess_training_tester, -- , -- , --);
    recog_word(--, --, matcher=&Tesseract::tess_default_matcher,
tester=NULL, trainer=tester (?!), testing=TRUE, --, --, --);
     recog_word_recursive(--, --,
matcher=&Tesseract::tess_default_matcher, tester=NULL, trainer=tester,
testing=TRUE, --, --, --);

Here {
   tess_tester = testing ? tester : NULL;    => tess_tester = NULL;
   tess_trainer = testing ? trainer : NULL;  => tess_trainer = tester;
(???)
}

and then, nothing happens..!! :-(

Thanks,
 Davide

On 7 Mag, 15:10, Dmitri Silaev <[email protected]> wrote:
> Could you be more specific: what exactly did you find on your subject
> and where? And how exactly do you see your training process?
>
> Until then, you may find useful to track the function calls inside the
> AdaptToWordStr() function declared in "baseapi.h"
>
> Warm regards,
> Dmitri Silaevwww.CustomOCR.com
>
>
>
>
>
>
>
> On Thu, May 5, 2011 at 2:59 PM, Davide Morellato <[email protected]> wrote:
> > Hi everybody.
> > I'm tring to do an answer-driven box generation, but can't find any
> > post about it. I mean, I've got the image and the corresponding text,
> > is there any way to have a box somehow coherent with the correct text?
> > I've been searching in the source for some hours, I found something
> > about it in BOOL8 testing, tess_trainer, tess_tester and so on, but
> > following the calls I ever reach dead code :-/
>
> > Thanks!
> >  Davide
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "tesseract-ocr" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > 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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

Reply via email to