python - 使用 pytesseract 将图像转换为数字
问题描述
我正在尝试将图像转换为数字文本,但我遇到了一些问题,输出出现了一些编码字符 (♀)。
这是我的代码:
import pytesseract
from PIL import Image
from pytesseract import image_to_string
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
text = pytesseract.image_to_string(Image.open("Capture.jpg"))
print(text)
我得到这个输出:
♀
我想要的输出:
021217
任何帮助解决这个问题,非常感谢
解决方案
推荐阅读
- vb.net - FlexGrid 树没有为整个网格创建节点
- git - git新手。测试分支不会与主分支合并,出现错误无法合并二进制文件
- javascript - 我可以将道具作为函数参数传递,或者这是一种不好的做法吗?
- firebase - Firebase Crashlytics 不会连接到同一项目中的辅助 Xamarin Android 应用程序
- php - 创建签名 url 以从 s3 存储桶获取文件时出错?
- android - PlacePicker 于 2019 年 11 月立即打开和关闭
- ubuntu - 无法在 Ubuntu 19.10 上启动设置(gnome-control-center)
- python - 使用现有 ODBC 配置凭据的 pyodbc 连接
- mysql - 从mysql中的另一个表创建用户名
- excel - 在将值与设置变量进行比较后,如何使此宏创建新工作表?