tessWrapper.py - haltosan/RA-python-tools GitHub Wiki

A quick hack for running tesseract inside a python program. The tesseract path needs to be changed to reflect the executable location.

tesseract(inSource, outSource, options=[])

Runs tesseract. inSource is the input argument (can be 'terminal' or 'input' to read from stdin). outSource is the output argument (can be 'terminal' or 'print' to write to stdout). options is a list of options passed in (oneWord() is an example of an argument).

Example:

tesseract(licensePlate.png, terminal, [oneWord()])

This would read in the license plate picture and print out the results. It treats the entire picture as one word.


oneWord()

Is an argument. Treats the entire image as one word.


tess(args)

Runs tesseract with the provided argument string. Lower level function called in tesseract()