【问题标题】:pyTesseract not outputing text from imagepyTesseract 不从图像输出文本
【发布时间】:2019-12-20 23:45:05
【问题描述】:

也许有人可以帮助我!当我运行以下代码时

导入 pytesseract 从 pytesseract 导入 image_to_string 从 PIL 导入图像 导入PIL

file = Image.open('/usr/local/Cellar/tesseract/4.1.0/share/tessdata/cap.png')
we_will = pytesseract.image_to_string(file)
print(we_will)

所有输出的是:

Process finished with exit code 0

这无济于事。我做错了什么?

【问题讨论】:

标签: python image-processing tesseract python-tesseract


【解决方案1】:

听起来we_will 是空字符串。尝试打印repr(we_will) 以更清楚地理解这个想法。

IIRC,当 PyTesseract 无法确定图像中的文本是什么时,它会执行此操作。对于具有单色背景的裁剪图像,您可以获得最佳效果。

【讨论】:

  • 谢谢,我试图使用 pyTesseract 破解验证码,但那毫无意义!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多