#Extract text from a single image using Python
from PIL import Image
from pytesseract import pytesseract
from PIL import Image
from pytesseract import pytesseract
#Define path to tessaract.exe
path_to_tesseract = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
#Define path to image
path_to_image = 'chemical.PNG'
#Point tessaract_cmd to tessaract.exe
pytesseract.tesseract_cmd = path_to_tesseract
#Open image with PIL
img = Image.open(path_to_image)
#Extract text from image
text = pytesseract.image_to_string(img)
print(text)
👋 Hi, I'm Suriya — QA Engineer with 4+ years of experience in manual, API & automation testing.
📬 Contact Me | LinkedIn | GitHub
📌 Follow for: Real-Time Test Cases, Bug Reports, Selenium Frameworks.
No comments:
Post a Comment