Orientation and WritingDirection
See original GitHub issueThanks for all you do. I have successfully created a batch OCR application using your wrapper. However, I occasionally run into an image where the text does not read from left-to-right. I have tried scouring the web to find the best method for determining page/text orientation. These methods are not demonstrated in the sample applications.
Here is my current page level code…
using (TesseractEngine engine = new TesseractEngine(System.Environment.GetEnvironmentVariable("TESSERACT_PREFIX"), "eng", EngineMode.Default))
{
Pix img = Pix.LoadFromFile(MyImgFilePath);
Page page = engine.Process(img);
img.Deskew();
//GetPageOrientation here
string text = page.GetText();
page.Dispose();
img.Dispose();
text = text.Replace("\n", "\r\n");
return text;
}
How would I “AutoRotate” to get the correct text?
I have attached an image for testing.
Issue Analytics
- State:
- Created 10 years ago
- Comments:31 (13 by maintainers)
Top Results From Across the Web
NSTextSelectionNavigation.WritingDirection
Values that describe the writing direction inside a text selection. ... Returns the layout orientation at the location you specify.
Read more >text-orientation - CSS: Cascading Style Sheets - MDN Web Docs
The text-orientation CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when ...
Read more >Writing Direction Affects How People Map Space Onto Time
What determines which spatial axis people use to represent time? We investigate effects of writing direction. English, like Mandarin Chinese ...
Read more >Orientation.WritingDirection Field
Writing direction. Namespace: Emgu.CV.OCR Assembly: Emgu.CV.Platform.NetStandard (in Emgu.CV.Platform.NetStandard.dll) Version: 4.5.5.4823.
Read more >Writing Direction Influences Spatial Cognition
The world's languages make use of different writing system orientations, running from left to right, from right to left, or from top to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After a little light reading it looks like tesseract the default page segmentation option doesn’t support Orientation detection by default you’ll need to change it to
PageSegMode.AutoOsd
and include the Osd language files. However the ones for 3.02 don’t seem to be on google code at the moment however the ones provided for ubuntu should work as these are only data files (https://launchpad.net/ubuntu/+source/tesseract-osd/3.02-2).Let me know if it works.
Hi I give this Exception Error when I use var properties = iter.GetProperties();
Exception thrown: ‘System.AccessViolationException’ in InteropRuntimeImplementer.TessApiSignaturesInstance An unhandled exception of type ‘System.AccessViolationException’ occurred in InteropRuntimeImplementer.TessApiSignaturesInstance Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Please help me