简体   繁体   中英

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?

have you note that, you should correct the last line

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM