title: Detect image orientation angle based on text direction
body: <p>I am working on a OCR task to extract information from multiple ID proof documents. One challenge is the orientation of the scanned image. The need is to fix the orientation of the scanned image of PAN, Aadhaar, Driving License or any ID proof.</p>
  
  <p>Already tried all suggested approaches on Stackoverflow and other forums such as OpenCV minAreaRect, Hough Lines Transforms, FFT, homography, tesseract osd with psm 0. None are working.</p>
  
  <p>The logic should return the angle of the text direction - 0, 90 and 270 degrees. Attached are the images of 0, 90 and 270 degrees. This is not about determining the skewness.<a href="https://i.stack.imgur.com/sn2yy.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/sn2yy.jpg" alt="enter image description here"></a></p>