Python PyteSeract无法从二值化图像中识别数字
我目前面临PyteSeract的一个问题,软件无法检测到此图像中的数字: 出于某种原因,pytesseract不想识别此图像中的数字。有什么建议吗?这是我的密码:Python PyteSeract无法从二值化图像中识别数字,python,tesseract,python-tesseract,Python,Tesseract,Python Tesseract,我目前面临PyteSeract的一个问题,软件无法检测到此图像中的数字: 出于某种原因,pytesseract不想识别此图像中的数字。有什么建议吗?这是我的密码: import pytesseract from PIL import ImageEnhance, ImageFilter, Image img = r'/content/inv_thresh.png' str = pytesseract.image_to_string(Image.open(img), lang='eng',
import pytesseract
from PIL import ImageEnhance, ImageFilter, Image
img = r'/content/inv_thresh.png'
str = pytesseract.image_to_string(Image.open(img), lang='eng', \
config='--psm 8 --oem 3 -c tessedit_char_whitelist=0123456789')
它返回一个字符串COTO
--oem 3
(默认值,基于可用内容。
)--oem 3
(默认值,基于可用内容。
)嗨,我真的不知道我用的是什么型号。我只需
pip安装pytesseract
,然后运行以下命令。我确实被困在获取数字的清晰图像上。这应该不是一项困难的任务,但我需要花很多时间才能用5个数字从这些图像中获得正确的数字。Pyteseract没有安装tesseract或tesseract模型(Pyteseract只是tesseract的包装器)。你做到了。你应该知道/理解你在做什么,否则你应该对随机的成功感到高兴。嗨,我真的不确定我用的是什么模型。我只需pip安装pytesseract
,然后运行以下命令。我确实被困在获取数字的清晰图像上。这应该不是一项困难的任务,但我需要花很多时间才能用5个数字从这些图像中获得正确的数字。Pyteseract没有安装tesseract或tesseract模型(Pyteseract只是tesseract的包装器)。你做到了。你应该知道/理解你在做什么,否则你应该对随机的成功感到高兴。
tesseract a9Uq4.png - --psm 8 --dpi 70
00308