You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.
importcv2fromPILimportImageimportsysimportpyocrimportpyocr.buildersfilename="xxx.jpg"tools=pyocr.get_available_tools()
iflen(tools) ==0:
print("No OCR tool found")
sys.exit(1)
# The tools are returned in the recommended order of usagetool=tools[0]
print("Will use tool '%s'"% (tool.get_name()))
# Ex: Will use tool 'libtesseract'langs=tool.get_available_languages()
print("Available languages: %s"%", ".join(langs))
lang=langs[0]
print("Will use lang '%s'"% (lang))
word_boxes=tool.image_to_string(
Image.open(filename),
lang="eng",
builder=pyocr.builders.WordBoxBuilder()
)
foriteminword_boxes:
print(item)
Result:
Will use tool 'Tesseract (sh)'
Available languages: eng, osd
Will use lang 'eng'
Process finished with exit code 0
The text was updated successfully, but these errors were encountered:
I am getting different response using tesseract and pyocr,
tesseract c++ code:
Result:
pyocr
python code:Result:
The text was updated successfully, but these errors were encountered: