Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

trasseract Unsupported image object

I learning python and I want read a document but ones words are diferent. I use this code,

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

img = cv2.imread('tes_palabra.png')

words = pytesseract.image_to_string(img)

print(words)

image used and required is https://ibb.co/KscWbD3

but return Unsupported image object

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try somethink like this, using Image module from PIL:

from PIL import Image 
import pytesseract

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

img_file = r'tes_palabra.png'
img = Image.open(img_file)
words = pytesseract.image_to_string(img)

print(words)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading