If you want to get words why do you use line level iterator?

Zdenko


On Wed, Dec 18, 2013 at 2:15 PM, Hsrt <[email protected]> wrote:

> Hello,
>
> I want to get each words in a text line by word iterator.But it isnot
> clear for me.
> My code is below. Do you have any idea?
>
>
>
>         Pix *image = pixRead("ex.jpg");
> tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
> api->Init(NULL, "eng");
>  api->SetImage(image);
> api->Recognize(0);
> tesseract::ResultIterator* ri = api->GetIterator();
>  tesseract::PageIteratorLevel level = tesseract::RIL_TEXTLINE;
> if (ri != 0) {
> do {
>
> const char* line = ri->GetUTF8Text(level);
>         float conf = ri->Confidence(level);
>          int x1, y1, x2, y2;
>         ri->BoundingBox(level, &x1, &y1, &x2, &y2);
>         printf("line: '%s' %d  %d %d  %d;\n",line, x1, y1, x2, y2);
>                         *  //  get each word in the "line"*
>         delete[] line;
>  } while (ri->Next(level));
>
> --
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to