-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
OSD Not working --psm=0,1,12 #1463
Comments
Also see: |
Console output
|
Re: "Error: Illegal Parameter specification! See #1010
So, far java, python etc
|
ok now it works when I used --psm 1 --oem 0 for the images :phototest-rotated-R/L/180.png . However it doesn't work with the image above. same for the C++ code. |
Paste the full command.
What do you mean by 'it doesn't work'? What's the output? |
|
Environment
Current Behavior:
I get this error "Error: Illegal Parameter specification!
"Fatal error encountered!" == NULL:Error:Assert failed:in file globaloc.cpp, line 75" or an empty output whenever I use the OSD (--psm=0,1,12). Also when I tried to extract Orientation, Direction and Skew angle I get 0 for all of them no matter what picture I use.
This is the picture I used:
![eurotext_skew tif](https://user-images.githubusercontent.com/38217333/38541276-e6bfddfc-3c9e-11e8-99fc-17b784a6b584.png)
![res cmd](https://user-images.githubusercontent.com/38217333/38547018-6f20724c-3cae-11e8-9c44-927fbd6f421e.png)
In command line I get this:
I tested it with the c++ code "Orientation and script detection (OSD) example" provided in the wiki:
![test osd](https://user-images.githubusercontent.com/38217333/38547147-bf1d180e-3cae-11e8-87d2-a957cff62fb8.png)
tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI(); api->Init(dataPath, "eng"); api->SetPageSegMode(tesseract::PSM_AUTO_OSD); api->SetVariable("tessedit_ocr_engine_mode","0"); api->SetVariable("tessedit_enable_dict_correction","1"); Pix *image = pixRead(imagePath); api->SetImage(image); tesseract::Orientation orientation; tesseract::WritingDirection direction; tesseract::TextlineOrder order; float deskew_angle; api->Recognize(0); tesseract::PageIterator* it = api->AnalyseLayout(); it->Orientation(&orientation, &direction, &order, &deskew_angle); printf("Orientation: %d;\nWritingDirection: %d\nTextlineOrder: %d\n Deskew angle: %.4f\n", orientation, direction, order, deskew_angle); // Get OCR result outText = api->GetUTF8Text(); meanConf=api->MeanTextConf();
I get this result :
And I tried it with a java code with the skewed image and Euronext.tif, I got this error:
![osd problem](https://user-images.githubusercontent.com/38217333/38542282-c6fcbf6e-3ca1-11e8-9314-3df88c1d5b20.png)
The text was updated successfully, but these errors were encountered: