如何解决pytesseract可以读取和打印指数吗?
使用此代码
'''
import cv2
import numpy as np
import pytesseract
from PIL import Image
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\New folder\tesseract.exe'
# Grayscale image
img = Image.open(r"C:\Users\gusta\Downloads\PyQuad-master\test.png").convert('L')
ret,img = cv2.threshold(np.array(img),180,500,cv2.THRESH_BINARY)
# Older versions of pytesseract need a pillow image
# Convert back if needed
img = Image.fromarray(img.astype(np.uint8))
print(pytesseract.image_to_string(img))
text = pytesseract.image_to_string(img)
with open('file.txt',mode ='w') as f:
f.write(text)
'''
我得到一个文本文件:
Find the y-intercept of the parabola with the followin
y = —6x? — 10x — 2
其中一位来自:
有没有办法让我读取^ 2指数并将其打印为^ 2?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。