v84
v84

Reputation: 3

Tesseract OCR cant recognize simple math symbols

so basicly im trying to make tesseract ocr do some elementary school math, but it wont work it prints out the math but not the answer to the math, here is my code

import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\alloa026\Downloads\project\photo.png'
content = pytesseract.image_to_string(r'C:\Users\alloa026\Downloads\project\photo.png')
print(eval("content.strip()"))

anyone know how to fix this?

Upvotes: 0

Views: 576

Answers (1)

Ace_of_King
Ace_of_King

Reputation: 71

have you note that, you should correct the last line

print(eval("content.strip()")
to
print(eval(content.strip())

Upvotes: 1

Related Questions