melad bader
melad bader

Reputation: 11

Solving difficult captcha using pytesseract

I am beginner at pytesseract.

I try to get the letters from those captcha images:

enter image description here

enter image description here

enter image description here

enter image description here

import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
pytesseract.image_to_string(Image.open('C:/Users/user/Desktop/download (2).png'))

But it gives me "" as output.

Upvotes: 0

Views: 814

Answers (1)

bhristov
bhristov

Reputation: 3187

You probably want to escape space and / characters. I suspect that this might be causing the issue.

pytesseract.pytesseract.tesseract_cmd = r'C:\Program\ Files\Tesseract-OCR\tesseract.exe'
pytesseract.image_to_string(Image.open('C:\/Users\/user\/Desktop\/download\ (2).png'))

Upvotes: 2

Related Questions