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

Reply via email to