E
E
Evloshevsky Nikolay2019-10-27 21:04:15
Python
Evloshevsky Nikolay, 2019-10-27 21:04:15

How to determine in Python that the text in the image is not horizontal and the image needs to be rotated?

There are pdf documents (scans of paper documents), I convert each sheet into an image and recognize it using pytesseract. But the problem is that some sheets in pdf have vertical orientation. It is necessary to determine which images need to be rotated by 90 degrees.
What library will help with this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evloshevsky Nikolay, 2019-10-27
@n1k_crimea

Actually, this is the solution.
In pytesseract there is a method image_to_osd, it returns the string:
Page number: 0
Orientation in degrees: 90
Rotate: 270
Orientation confidence: 23.51
Script: Cyrillic
Script confidence: 10.63
there is also EXIF ​​- this article is well described https://habr.com/ru /post/471112/, but it doesn't suit me because I'm working with a converted image

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question