コード例 #1
0
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)
コード例 #2
0
ファイル: ocr.py プロジェクト: ThePenguin1140/jabbapylib
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)
コード例 #3
0
ファイル: test_ocr.py プロジェクト: the7day/jabbapylib
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
コード例 #4
0
ファイル: test_ocr.py プロジェクト: ThePenguin1140/jabbapylib
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