def process(files): """ Process each image file and OCR them. The result is printed to the stdout. """ for index,f in enumerate(files): if index > 0: print '-' * 10 print image_file_to_string(f)
def test_image_file_to_string(): print 'tesseract version:', cfg.MY_TESSERACT # res = ocr.image_file_to_string(TEST_DIR + '/fnord.tif') assert res == 'fnord' or res == 'fnorcl' # # res = ocr.image_file_to_string(TEST_DIR + '/fonts_test.png') # print res # # res = ocr.image_file_to_string(TEST_DIR + '/phototest.tif') # print res assert res == ex.PHOTOTEST_TIF