Created
June 14, 2019 07:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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