Skip to content

Instantly share code, notes, and snippets.

@scionoftech
Created June 14, 2019 07:09
Show Gist options
  • Save scionoftech/6375cf9146db2ccd74cc24bd56e01e92 to your computer and use it in GitHub Desktop.
Save scionoftech/6375cf9146db2ccd74cc24bd56e01e92 to your computer and use it in GitHub Desktop.
This is a python script to read text from image using tesseract ocr
from PIL import Image
import numpy as np
import pytesseract
# pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files (x86)\Tesseract-OCR\tesseract.exe"
original = Image.open(IMAGE_PATH)
#original.show()
img = np.array(original)
img_str = pytesseract.image_to_string(img)
print(img_str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment