Closed GoogleCodeExporter closed 9 years ago
I just noticed that the errors I reported are not fixed by my patch. It seems
that for some other reason the coordinates were correct during my tests after
applying the patch.
Original comment by p.vorb...@gmail.com
on 23 Apr 2014 at 7:20
Can you provide simple test case with (input) image, so we can have a look on
it?
Original comment by zde...@gmail.com
on 24 Apr 2014 at 8:15
Sorry, it seems I didn't receive an email notification.
I attached an image that (sometimes) causes the error.
I get the errors through my own custom Java wrapper, which isn't released yet.
Today I tried to get the error through C++ code, but I couldn't. Here's the
code I used:
Pix *image = pixRead("fries_example.png");
tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
api->Init(NULL, "deu-frak");
api->SetImage(image);
api->Recognize(0);
tesseract::ResultIterator* ri = api->GetIterator();
tesseract::PageIteratorLevel level = tesseract::RIL_WORD;
if (ri != 0) {
do {
const char* word = ri->GetUTF8Text(level);
float conf = ri->Confidence(level);
int x1, y1, x2, y2;
ri->BoundingBox(level, &x1, &y1, &x2, &y2);
printf("word: '%s'; BoundingBox: %d,%d,%d,%d;\n",
word, x1, y1, x2, y2);
delete[] word;
} while (ri->Next(level));
}
My Java code is basically doing the same using the C API.
Since I didn't get the error in my C++ program, it has got something to do with
the Java wrapper I am using or the way I am initializing the recognition
process. I'll look into the Java code again and let you know when I find the
problem.
Original comment by p.vorb...@gmail.com
on 2 May 2014 at 10:37
Attachments:
The error was a concurrency issue in Java. I initialized the API in one thread
and then iterated over the recognition results in another thread, which caused
the problem. I still don't know why exactly the y coordinates (and no other)
were affected, but using the same thread to initialize and iterate gives me
correct results.
This issue may be closed.
Original comment by p.vorb...@gmail.com
on 2 May 2014 at 10:52
Original comment by zde...@gmail.com
on 2 May 2014 at 3:26
Original issue reported on code.google.com by
p.vorb...@gmail.com
on 19 Apr 2014 at 11:21Attachments: