Des*_*wal 7 ocr tesseract image-processing computer-vision python-tesseract
如何使用tesseract来提取数学方程?
在阅读下面给出的图像时:
使用后:
img = cv2.imread(IN_PATH+'sample1.png')
pytesseract.image_to_string(img)
Run Code Online (Sandbox Code Playgroud)
我得到的结果是:
'The value of 7/8144 is\n- (a) 20.2 (b) 20.16\n(c) 20.12 (d) 20.4'
Run Code Online (Sandbox Code Playgroud)
对于旧版本,我可以使用
config='-l eng + equ'
pytesseract.image_to_string(img,config=config)
Run Code Online (Sandbox Code Playgroud)
但equ中不再支持tesseract 4.0+。我也有equ.traineddata文件,但我不知道它是如何工作的,当我尝试将其粘贴到文件中时,/usr/share/tesseract-ocr/4.00/tessdata/它抛出了一个无法复制的错误。
请帮助我如何提取一些带有简单数学符号的文本。