How to use the pyocr.libtesseract.detect_orientation function in pyocr

To help you get started, we’ve selected a few pyocr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openpaperwork / pyocr / tests / tests_libtesseract.py View on Github external
def test_orientation_90(self):
        img = base.Image.open(self._path_to_img("test-90.png"))
        result = libtesseract.detect_orientation(img, lang='eng')
        self.assertEqual(result['angle'], 90)
github openpaperwork / pyocr / tests / tests_libtesseract.py View on Github external
def test_orientation_0(self):
        img = base.Image.open(self._path_to_img("test.png"))
        result = libtesseract.detect_orientation(img, lang='eng')
        self.assertEqual(result['angle'], 0)