Sometimes the setup settings, I actually forgot.
Error - RuntimeError: invalid rotation plane specified
Actual Setup - Copy your opencv_ffmpeg.dll to C:\Python27\ and rename it to relevant your OpenCV Python Version. In my case, I had to rename it to opencv_ffmpeg240.dll
In my case opencv version was 3.4.1
Often, These setup steps are missed once things start working. This link was useful - link
Happy Learning!!!
March 29, 2018
March 09, 2018
Day #101 - OCR and Python
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!!!
Labels:
Data Science,
Data Science Tips,
OCR
Subscribe to:
Posts (Atom)