1 ddddocr简介:
ddddocr是一个开源图片识别库,Github地址:
https://github.com/sml2h3/ddddocr
经测试发现,ddddocr在识别验证码类型的图片时,准确率还是很高的。
2 ddddocr的安装:
pip install ddddocr
或
pip install ddddocr -i 镜像,例如:pip install ddddocr -i https://pypi.tuna.tsinghua.edu.cn/simple
常用国内镜像源:
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华为云:https://mirrors.huaweicloud.com/python/
豆瓣:https://pypi.douban.com/simple/
3 ddddocr的使用:
图片识别举例:
代码:
# -*- coding: utf-8 -*-
import os
import ddddocr
# 图片识别函数
def img2text(img_file):
ocr = ddddocr.DdddOcr() #法1
# ocr = ddddocr.DdddOcr(det=True) #法2
cPath = os.getcwd()
print(cPath)
with

最低0.47元/天 解锁文章
15万+

被折叠的 条评论
为什么被折叠?



