pytesseract installation steps
1. Download for windows https://github.com/tesseract-ocr/tesseract/wiki/4.0-with-LSTM#400-alpha-for-windows
2. Installed - Windows Installer made with MinGW-w64 from UB Mannheim
3. This post was useful - https://stackoverflow.com/questions/34225927/pytesseract-cannot-find-the-file-specified
4. Pip install of pytesseract
5. Created Env Variable - TESSDATA_PREFIX=C:\Program Files (x86)\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
import sys | |
import cv2 | |
import numpy as np | |
import pytesseract | |
from PIL import Image | |
img = Image.open("E:\\RNotes\\ML_AI_Projs\\12.jpg") | |
pytesseract.pytesseract.tesseract_cmd = "C:\\opencv\\Tesseract-OCR\\tesseract" | |
print(pytesseract.image_to_string(img)) |
Happy Learning!!!
No comments:
Post a Comment