Ai
1 Star 0 Fork 0

github_repo/ocr-table

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
py_ocr.py 484 Bytes
一键复制 编辑 原始数据 按行查看 历史
cseas 提交于 2018-11-21 15:02 +08:00 . Add alternate
# alternate approach using pyocr
from PIL import Image
import sys
import pyocr
import pyocr.builders
import codecs
tool = pyocr.get_available_tools()[0]
builder = pyocr.builders.TextBuilder()
txt = tool.image_to_string(
Image.open('file.tiff'),
lang="eng",
builder=builder
)
# txt is a Python string
with codecs.open("toto.txt", 'w', encoding='utf-8') as file_descriptor:
builder.write_file(file_descriptor, txt)
# toto.txt is a simple text file, encoded in utf-8
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/github_repo/ocr-table.git
git@gitee.com:github_repo/ocr-table.git
github_repo
ocr-table
ocr-table
master

搜索帮助