Thanks hiran...but that doesn't seem to work either... :(
In addition to the error "invalid use of incomplete type ‘struct
tesseract::ResultIterator’"
I am getting errors like: " ‘ChoiceIterator’ is not a member of
‘tesseract’".

Incidentally, i am using tesseract 3.01. What verison of tesseract did your
code work on?


On Sun, Jun 17, 2012 at 9:58 PM, hiran.suvrat <[email protected]>wrote:

> Hi,
>
> Try this code[1] .. should help you. I also gives you confidence and
> choices values for a character.
>
>
>
> {
>  tesseract::TessBaseAPI  tess;
> tess.SetVariable("save_blob_choices", "T");
> tess.SetImage(...);
> tess.Recognize(0);
>
> tesseract::ResultIterator* ri = tess.GetIterator();
> tesseract::ChoiceIterator* ci;
>
> if(ri != 0)
> {
>    do
>    {
>        const char* symbol = ri->GetUTF8Text(tesseract::RIL_SYMBOL);
>
>        if(symbol != 0)
>        {
>            float conf = ri->Confidence(tesseract::RIL_SYMBOL);
>            std::cout << "\tnext symbol: " << symbol << "\tconf: " <<
> conf << "\n";
>
>            const tesseract::ResultIterator itr = *ri;
>            ci = new tesseract::ChoiceIterator(itr);
>
>            do
>            {
>                const char* choice = ci->GetUTF8Text();
>                std::cout << "\t\t" << choice << " conf: " << ci-
> >Confidence() << "\n";
>            }
>            while(ci->Next());
>
>            delete ci;
>        }
>
>        delete[] symbol;
>    }
>    while((ri->Next(tesseract::RIL_SYMBOL)));
> }
>
>
> [1]
> http://stackoverflow.com/questions/7925898/can-not-use-choiceiterator-in-tesseract
>
> Regards,
> Suvrat
> On Jun 17, 3:48 pm, uni <[email protected]> wrote:
> > hi...while trying to generate individual character confidence values, i
> am
> > getting the error:
> >  invalid use of incomplete type ‘struct tesseract::ResultIterator’
> >
> > Can anyone please help me out?
> >
> > thanks in advance
> > Uni
>
> --
> 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