-
Notifications
You must be signed in to change notification settings - Fork 744
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
PageSegMode.OsdOnly orientation always PageUp #156
Comments
Do you have the orientation scripts installed in your tessdata directory, check out Issue #109. |
Yes, osd.traineddata is included and PageSegMode.AutoOsd works correctly. PageSegMode.OsdOnly always brings PageUp I am trying to get PageSegMode.OsdOnly work because I think it will work faster than PageSegMode.AutoOsd: In our system we firstly detect orientation, rotate file and then process page with PageSegMode.SingleBlock. We do processing with multiple threads and trying to reduce processing times. Regards |
Thanks, I've had a look into this and apparently your supposed to use the
|
I've had another look into this and I was wrong when I mentioned that this functionality was not exposed via the CAPI 3.02. I should be able to expose this functionality however it should be noted that it only returns the orientation (e.g. Page UP, Page Down, etc) and script. I'm not sure I can expose the script information as this generally requires access to some C++ classes which I don't have access to from .NET. Note the deskew angle is NOT exposed\available. If you need that information you'll need to use AutoOSD with AnalyseLayout. |
Hi Charles, thank you for information. Can we contribute somehow in speeding up 3.04 release? |
I've implemented this support in the current dev branch (targets 3.02) and it will be in the next release, probably latter this week. Can you also test it to see if it's working for you? Note that it only exposes the orientation and corresponding confidence not the script information as I couldn't get hold of that easily. In regards to supporting 3.04 the main blocker here is that this has to wait until after 3.04 has been officially released. After that it shouldn't take to long to release an updated version of this wrapper that uses this version of Tesseract though it probably won't expose ALL of the new functionality right away (I tend to weight until someone explicitly requests something, ideally with a particular use case in mind). Usage Example:
|
Hi Charles, thanks a lot for this improvement, it works. I will test a bit more and let you know results. |
Hi, It will be very helpful in a specific project that I´m working. Congratulations! Carlos Flávio Barreto Ferreira de Souza |
Hi, so according to our tests accuracy of orientation is about 95% with DetectBestOrientation in 3.02 comparing to 98% with custom 3.04 build. But 3.04 is 35% slower than 3.02. Still cant understand though why OCR with AutoOSD brings such a poor results comparing to DetectBestOrientation in same 3.02 build. Waiting for official release of wrapper, thanks again Charles. |
Okay, thanks for the extra testing. I'll do an official release later today.
|
The new release 2.3.0 is out. |
Hi,
I need to detect page orientation only (no OCR).
If I process image with PageSegMode.OsdOnly, detected Orientation is always PageUp:
using (Bitmap src = Image.FromStream(imageStream) as Bitmap)
{
using (TesseractEngine tesseractEngine = new TesseractEngine(_tessdataPath, "eng", EngineMode.Default))
{
tesseractEngine.DefaultPageSegMode = PageSegMode.OsdOnly;
...
}}}}
this code seems to work only if DefaultPageSegMode = PageSegMode.AutoOsd;
Any idea why?
Thanks
Bogdan
The text was updated successfully, but these errors were encountered: