image to text in python using pytesseract





step-1

first download the tesseract EXE and install from here

step-2

 pip install pytesseract

step-3

import pytesseract as tess

try:

    import Image

except ImportError:

    from PIL import Image


tess.pytesseract.tesseract_cmd = r"C:\Program Files (x86)\Tesseract-OCR\tesseract.exe"

img = Image.open(r"C:\Users\darsh\OneDrive\Desktop\gujju computervalo\image1.png")

print(img)

text = tess.image_to_string(img)

print(text)



input image >>


output >>





Comments