51cto学院:人工智能OpenCV合集
2023-02-15 13:56 作者:bili_1559000721 | 我要投稿
在这里我们首先利用 Image 读取了图片文件,然后调用了 tesserocr 的 image_to_text() 方法,再将将其识别结果输出。
运行结果:
Python3WebSpider
另外我们还可以直接调用 file_to_text() 方法,也可以达到同样的效果:
import tesserocr
print(tesserocr.file_to_text('image.png'))
运行结果:
Python3WebSpider
如果成功输出结果,则证明 Tesseract 和 Tesserocr 都已经安装成功。

