Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get page orientation?

See original GitHub issue


I’m a bit confused about the proper way to get the page orientation with tesseract. I have tried the following:

using (var pi = page.AnalyseLayout())
    return pi.GetProperties().Orientation;

But it always returns PageUp.

I have also tried page.DetectBestOrientation(out int orientation, out _) but this returns 270 even for a page that is supposed to be PageUp.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

Olby2000commented, Jun 16, 2021

@tudorserbanuipath You need to have “osd.traineddata” file in the tessdata folder and when initializing the engine set language to “osd” - this worked for me to detect orientation e.g. using var engine = new TesseractEngine(@"./tessdata", "osd", EngineMode.Default);

kanashiilovecommented, Sep 5, 2022

@samtigall Replace using (var page = engine.Process(img)) by using (var page = engine.Process(img, PageSegMode.AutoOsd))

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change PDF orientation from landscape to portrait
Open your PDF in Adobe Reader. Select View and then Rotate View. Select Clockwise or Counterclockwise to rotate in 90-degree increments. How to...
Read more >
Change A Single Page To Landscape In Word - YouTube
In this video, I'm going to show you how to change the orientation of a single page to landscape in Microsoft Word.
Read more >
How to Change Page Orientation in Adobe Acrobat - YouTube
Learn two ways to change page orientation in Adobe Acrobat. Plus, learn how to view pages in a different orientation without changing the ......
Read more >
Changing the Page Orientation in Microsoft Word - YouTube
... orientation -of-one- page -in-word/ Get ... Check out our free video playlist for Microsoft Office ...
Read more >
How to have multiple page orientations in one document
This is a Microsoft Word tutorial. Page orientation. How to have multiple page orientations in one document #msword Join this channel to get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found