Commit 27f9caf6 authored by Jerome Flesch's avatar Jerome Flesch

README: Add examples regarding the use of boxes

Signed-off-by: default avatarJerome Flesch <jflesch@wyplay.com>
parent ef5d6704
......@@ -21,7 +21,7 @@ bmp, tiff, and others. It also support bounding box data.
from pyocr import pyocr
import pyocr.builders
tools = pyocr.get_available_tools()[:]
tools = pyocr.get_available_tools()
if len(tools) == 0:
print("No OCR tool found")
sys.exit(1)
......@@ -29,6 +29,12 @@ bmp, tiff, and others. It also support bounding box data.
txt = tools[0].image_to_string(Image.open('test.png'),
lang='fra',
builder=pyocr.builders.TextBuilder())
word_boxes = tools[0].image_to_string(Image.open('test.png'),
lang='fra',
builder=pyocr.builders.WordBoxBuilder())
line_and_word_boxes = tools[0].image_to_string(Image.open('test.png'),
lang='fra',
builder=pyocr.builders.LineBoxBuilder())
## Dependencies
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment