Learn practical skills, build real-world projects, and advance your career
import matplotlib.pyplot as plt
import PIL
import pytesseract
%matplotlib inline
img = PIL.Image.open('images/eng.png')
plt.imshow(img, cmap='gray')
<matplotlib.image.AxesImage at 0x1fe5bac4d68>
Notebook Image

convert img to txt

pytesseract.pytesseract.tesseract_cmd = r'C:\Users\OHIDUL ISLAM\.conda\envs\tesseract\Library\bin\tesseract.exe'
TESSDATA_PREFIX = r'C:\Users\OHIDUL ISLAM\.conda\envs\tesseract\Library\bin\tesseract.exe'
text_data = pytesseract.image_to_string(img.convert('RGB'), lang='eng')