-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assert failed #989
Comments
Reference issue in tesserocr: sirfz/tesserocr/issues/55 |
@sirfz, can you provide a C++ example program that reproduces the issue? |
Not tested but it should look something like (based on the basic API example): #include <tesseract/baseapi.h>
#include <leptonica/allheaders.h>
int main()
{
tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
ETEXT_DESC monitor;
// Initialize tesseract-ocr with Spanish, without specifying tessdata path
if (api->Init(NULL, "spa")) {
fprintf(stderr, "Could not initialize tesseract.\n");
exit(1);
}
// Open input image with leptonica library
Pix *image = pixRead("pil_image.png");
api->SetImage(image);
// Recognize (should crash here)
api->Recognize(&monitor);
return 0;
} Here's the image saved using PIL: |
After writing the code above, I modified tesserocr to call |
Yes. If you want to use monitor, see here: |
Thanks @amitdo for pointing to a usage example, will definitely add the timeout feature to tesserocr 👍 |
The original issue was fixed by @sirfz in his tesserocr, so this issue should be closed. |
Hello,
I was trying to perform OCR using tesserocr wrapper (python)
and this code:
For the image I tried I got this in console:
start >= 0 && start + num <= length_:Error:Assert failed:in file ratngs.cpp, line 321
I reported the problem and talked to the creator of the wrapper and he provided me with a workaround to make it work
He thinks that most likely the problem is in tesseract and not in pillow. So here I am trying to let you know :)
This is what I am using
Linux localhost.localdomain 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
tesseract 3.05.01
leptonica-1.74.1
libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.5.13 : libtiff 4.0.3 : zlib 1.2.7
And this is the image
I am not very familiar with the C++ API, otherwise I would create a program and try to reproduce it with it and be sure this is a tesseract issue. Thanks in advance.
Best Regards.
Jorge
The text was updated successfully, but these errors were encountered: