为什么pytesseract无法在此简单图像中识别数字?

为什么pytesseract无法在此简单图像中识别数字?,第1张

为什么pytesseract无法在此简单图像中识别数字?

试试

--psm 13 --oem 3
oem
= 1或2也应该这样做)

import pytesseractfrom PIL import Imageimport requestsimport ioresponse = requests.get('https://i.stack.imgur.com/oAAXR.png')text = pytesseract.image_to_string(Image.open(io.BytesIO(response.content)), lang='eng',         config='--psm 13 --oem 3 -c tessedit_char_whitelist=0123456789')print(text)

49
在您的机器上达到您期望的产量。

通过本地下载图像并启动,我得到相同的结果

tesseract oAAXR.png output --oem 3 --psm 13 -l eng

仅供参考

tesseract --version
tesseract 4.0.0 leptonica-1.77.0 libgif 5.1.4 :libjpeg 8d (libjpeg-turbo 2.0.1) : libpng 1.6.36 : libtiff 4.0.10 : zlib1.2.11 : libwebp 1.0.1 Found AVX2 Found AVX Found SSE



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5668367.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存