2 years ago

#70463

test-img

Rapid1898

Try to ocr text form image / error message pytesseract?

i try to scrape text from an image using pytesseract with the following code:

import pytesseract
from PIL import Image

path_to_tesseract = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
imagePath = r"C:\Users\Polzi\Documents\DEV\Fiverr\TRY\johngreen683\pic2.jpeg"
r"C:\Users\Polzi\Documents\DEV\Fiverr\TRY\johngreen683\d.jpg"
pytesseract.tesseract_cmd = path_to_tesseract
img = Image.open(imagePath)
text = pytesseract.image_to_string(img)
print(text)

I want to scrape the text form the following picture: enter image description here

But unfortunately the output of the scraping is always empty.

Is there any way to get the text scraped form such a picture?

python

python-imaging-library

ocr

tesseract

0 Answers

Your Answer

Accepted video resources