Created
March 20, 2014 20:42
-
-
Save roger-link/9673385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyocr | |
import pyocr.builders | |
import glob | |
import Image | |
tools = pyocr.get_available_tools() | |
tool = tools[0] | |
langs = tool.get_available_languages() | |
lang = langs[0] | |
IMAGE_PATH = '/home/ubuntu/images/*' | |
files = glob.glob(IMAGE_PATH) | |
text = {} | |
for file in files: | |
text[file] = tool.image_to_string(Image.open(file), | |
lang=lang, | |
builder=pyocr.builders.TextBuilder()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment