Skip to content

baixabhi/image_to_text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

image_to_text

from PIL import Image import pytesseract # Import the pytesseract module

class ImageReader: def init(self, tesseract_path): pytesseract.pytesseract.tesseract_cmd = tesseract_path

def extract_text(self, image_path):
    return pytesseract.image_to_string(Image.open(image_path))

if name == 'main': tesseract_path = r'C:\Program Files\Tesseract-OCR\tesseract.exe' image_path = r'C:\Users\abhij\OneDrive\Desktop\Image_extract\newpoem.png' extracted_text = ImageReader(tesseract_path).extract_text(image_path) print(extracted_text)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages