pyTesseract不从图像输出文本

问题描述 投票:0回答:1

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

导入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个回答
0
投票
IIRC,当PyTesseract无法确定图像中的文本内容时,便会执行此操作。对于具有单色背景的裁剪图像,您可以获得最佳效果。
© www.soinside.com 2019 - 2024. All rights reserved.