I'm trying to get the orientation of text from an image. I have 8 type of images with different orientation, look at all type in the next image (I will put a link of a repository which you can get all images inputs):
I was using these lybraries to detect orientation of my text from an image.
import pytesseract as tess
from PIL import Image
my_image = Image.open(temp_image_path)
osd = tess.image_to_osd(my_image)
print(osd)
Output: this is what i got
> Page number: 0
Orientation in degrees: 270
Rotate: 90
Orientation confidence: 2.77
Script: Cyrillic
Script confidence: 2.88
however, I don't get why sometimes a vertical plan with a vertical text (type II from my image) has an output like this: Rotate: 90 or Rotate: 270.
I used opencv and tensorflow, they helped me to get similarities but not to identify if my text has a different orientation.
This is the Repository from github: Click Here to watch the repository with inputs