openpaperwork / pyocr

A Python wrapper for Tesseract and Cuneiform -- Moved to Gnome's Gitlab
https://gitlab.gnome.org/World/OpenPaperwork/pyocr
930 stars 152 forks source link

tesseract4 error in detect orientation #96

Closed simonm3 closed 6 years ago

simonm3 commented 6 years ago

I am using the alpha tesseract4 from ppa:alex-p/tesseract-ocr on ubuntu 16.04.

tool.detect_orientation(img) gives error as below: KeyError Traceback (most recent call last) /anaconda3/lib/python3.6/site-packages/pyocr/tesseract.py in detect_orientation(image, lang) 213 output = {x: y for (x, y) in output} --> 214 angle = int(output.get('Rotate', output['Orientation in degrees'])) 215 # Tesseract reports the angle in the opposite direction the one we

KeyError: 'Orientation in degrees'

simonm3 commented 6 years ago

works fine on the windows binary so I am guessing linux binary is out of date as understand they are aiming for same interface.