-
Notifications
You must be signed in to change notification settings - Fork 19
Examples
gregjurman edited this page Aug 14, 2011
·
5 revisions
These examples will get you up and running with Tesserwrap quickly.
If you need to quickly OCR an entire image (eg. a page of text) the ocr_image
function will send the entire image to Tesseract and return a string of the contained data. Currently Tesserwrap can only handle gray-scale images and will convert any image you give it to gray-scale.
import Image
from tesserwrap import tesseract
# Open an image
im = Image.open("test.png")
# Create a Tesseract object
tw = tesseract()
# OCR the image and return a string
print tw.ocr_image(im)