Hi!
I'm using tesseract (version 2.04 / Linux) to recognize text extracted
from images.
My problem is that apparently I have different results by appling
twice a tesseract function on the same bitmap. I suppose that I have
to clean something... What? Thank you for any help!
I reduce the problem as in the test program below. The output is:
> Read 0. string as: NNCH UNION
>
>
> Read 1. string as: UNCH UNION
>
>
If I include the calls "InitWithLanguage" and "End" in the body of the
loop I obtain the following strings as output:
> Read 0. string as: NNCH UNION
>
>
> Read 1. string as: MCH UNION
>
>
Test code:
#include <baseapi.h>
int main(int argc, char *argv[])
{
GenMatType *board = NULL; //my internal image structure
char *ocred_text = NULL;
// LINE_4.tif is a bitmap w=128 x h=60, with values 0|255
board = GMRead("/tmp/LINE_4.tif", NULL);
TessBaseAPI::InitWithLanguage(NULL, NULL, "eng", NULL, false, 0,
NULL);
for (int i = 0; i < 2; i++) {
ocred_text =
TessBaseAPI::TesseractRect(board->udata[0], 1, board->cols,
0, 0, board->cols, board->rows);
fprintf(stdout, "Read %d. string as: %s\n", i, ocred_text);
//cleanup
delete[] ocred_text;
}
TessBaseAPI::End();
GMFree(board);
return(0);
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---