0

I have an image like this which is in different position

'https://i.stack.imgur.com/sEEsQ.jpg' is the image url. I want to rotate it to normal position. I mean if image is in any position, it should rotate to the normal position

How to write a code to rotate the image to normal position.

beaker
  • 16,331
  • 3
  • 32
  • 49
Nithin Reddy
  • 580
  • 2
  • 8
  • 18
  • Will the image (in normal position) always have a wide aspect ratio? Will it always contain a face(s)? – Akshay Sehgal Mar 02 '21 at 15:57
  • No faces, it's a document. Like an invoice. – Nithin Reddy Mar 02 '21 at 16:37
  • Does this answer your question? [Using OpenCV, how can I detect text orientation before performing OCR?](https://stackoverflow.com/questions/10122635/using-opencv-how-can-i-detect-text-orientation-before-performing-ocr) – Akshay Sehgal Mar 02 '21 at 16:45
  • No, the code should check if it's in normal position or not. If it is not in normal position, then it should rotate to normal. – Nithin Reddy Mar 02 '21 at 16:47
  • 1
    There is no direct way to solve this unless you are able to use the text orientation to understand which direction is your text going. Then use that to rotate. – Akshay Sehgal Mar 02 '21 at 16:49
  • Okay, I'll try to do that. – Nithin Reddy Mar 02 '21 at 16:57
  • See https://stackoverflow.com/a/62029641/2836621 and https://pillow.readthedocs.io/en/stable/handbook/concepts.html?highlight=Orientation%20#orientation – Mark Setchell Mar 02 '21 at 19:07

0 Answers0