Skip to content

Instantly share code, notes, and snippets.

@parkkk123
Last active September 12, 2020 05:47
Show Gist options
  • Save parkkk123/50b68d3a82bb2a4c2ae6fb3969072db5 to your computer and use it in GitHub Desktop.
Save parkkk123/50b68d3a82bb2a4c2ae6fb3969072db5 to your computer and use it in GitHub Desktop.
Getting start with tesseract on python
from tesserocr import PyTessBaseAPI
from PIL import Image
with PyTessBaseAPI(lang="tha") as api:
#ลบช่องว่างแต่ละตัวอักษร
api.SetVariable('preserve_interword_spaces', '1')
#Path ของรูปภาพ
api.SetImageFile("Image.jpeg")
print(api.GetUTF8Text())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment