I'm using the tesserocr library to perform OCR on an image. Some of the words in the image are vertical, and some are horizontal. Is there any way to tell the orientation of the words in the image on a per-word basis from this library? I want something like
with PyTessBaseAPI() as api:
api.SetImage(image)
api.Recognize()
ri = api.GetIterator()
level = RIL.WORD
word_boxes = api.GetComponentImages(RIL.TEXTLINE, True)
box_info = api.GetWords()
for r in iterate_level(ri, level):
# TODO: somehow get orientation here
word = r.GetUTF8Text(level)
print(r.orientation())