python-3.x - Pytesseract OCR
问题描述
这是我第一次编码。我希望得到有关如何从 Image Passport/ID 中提取文本的指导。使用 python-Tesseract OCR,我对 Tesseract 的文档进行了研究,但没有得到足够的解释。
解决方案
Import PIL and pytesseract
import PIL.Image
import pytesseract
Load your image
my_image = PIL.Image.open("Path/To/My_Image.jpg")
Run tesseract on it
my_image_text = pytesseract.image_to_string(my_image)
print(my_image_text)
推荐阅读
- ruby-on-rails - 安装 json (1.8.1) 时出错,Bundler 无法继续
- angularjs - 显示 div 取决于使用 ng-show、ng-click、ng-init 的点击次数
- javascript - 简单的 Rails 应用程序 - 未捕获的 ReferenceError:$ 未定义
- android - web3j 和 web3js 中的签名不同?
- java - CalendarView 在片段中不起作用?安卓
- c# - 无法在 Azure DevOps 2019 通过代码(无权限)创建代理池
- flutter - 未定义命名参数“colors”。flutter
- java - 无法评估具有 [@xsi:type='ED'] 类型的 Xpath xpression
- amazon-web-services - DynamoDB GSI 分区包含大型集
- python - 在 Django 中检索自定义异常的翻译文本