Exemple #1
0
def test_tesseract_orientation(resources, tmp_path):
    pix = leptonica.Pix.open(resources / 'crom.png')
    pix_rotated = pix.rotate_orth(2)  # 180 degrees clockwise
    pix_rotated.write_implied_format(tmp_path / '000001.png')

    tesseract.get_orientation(  # Test results of this are unreliable
        tmp_path / '000001.png', engine_mode='3', timeout=10
    )
Exemple #2
0
 def get_orientation(input_file, options):
     return tesseract.get_orientation(
         input_file,
         engine_mode=options.tesseract_oem,
         timeout=options.tesseract_timeout,
     )