当前位置:网站首页>easyOCR 字符识别
easyOCR 字符识别
2022-07-05 14:44:00 【天人合一peng】
import easyocr
import cv2
import os
reader = easyocr.Reader(['en'],model_storage_directory="./easyOCRModel")
path = r"D:\BUFFER\Pycharm\RecognitionOCR\images\ROI_Images"
# path = r"D:\BUFFER\Pycharm\RecognitionOCR\images\rudeOCR"
for filename in os.listdir(path): # listdir的参数是文件夹的路径
img_path = path + '\\' + filename
# print(filenames)
img_orig = cv2.imread(img_path, 1)
# cv2.imshow("image", img_orig)
# cv2.waitKey()
result = reader.readtext(img_path)
if result and result[0][2] >= 0.90:
print(img_path)
print(result[0][1])
print(result[0][2])
# str_j = 'python {}! format {}!'.format(666, 999)
ocr_possible = ' {}-{}!'.format( result[0][1], result[0][2])
cv2.putText(img_orig, ocr_possible , (2, 20), cv2.FONT_HERSHEY_SIMPLEX, 0.75, (0, 0, 255), 2)
cv2.imshow("image", img_orig)
cv2.waitKey()
边栏推荐
- GPS原始坐标转百度地图坐标(纯C代码)
- Section - left closed right open
- Online electronic component purchasing Mall: break the problem of information asymmetry in the purchasing process, and enable enterprises to effectively coordinate management
- mysql8.0JSON_CONTAINS的使用说明
- Is the securities account given by the head teacher of qiniu school safe? Can I open an account?
- 做自媒体视频二次剪辑,怎样剪辑不算侵权
- Topology可视化绘图引擎
- Postgresql 13 安装
- 【華為機試真題詳解】歡樂的周末
- MongDB学习笔记
猜你喜欢
随机推荐
Selection and use of bceloss, crossentropyloss, sigmoid, etc. in pytorch classification
开挖财上的证券账户可以吗?安全吗?
729. My schedule I: "simulation" & "line segment tree (dynamic open point) &" block + bit operation (bucket Division) "
CPU设计实战-第四章实践任务三用前递技术解决相关引发的冲突
CPU design practice - Chapter 4 practice task 3 use pre delivery technology to solve conflicts caused by related issues
Postgresql 13 安装
Change multiple file names with one click
SSL证书错误怎么办?浏览器常见SSL证书报错解决办法
Loop invariant
PyTorch二分类时BCELoss,CrossEntropyLoss,Sigmoid等的选择和使用
Thymeleaf th:with use of local variables
Thymeleaf th:with局部变量的使用
Thymeleaf 使用后台自定义工具类处理文本
dynamic programming
How can non-technical departments participate in Devops?
Type declaration of all DOM elements in TS
webRTC SDP mslabel lable
危机重重下的企业发展,数字化转型到底是不是企业未来救星
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
Google eventbus usage details


![[learning notes] stage test 1](/img/22/ad16375d8d1510c2ec75c56403a8bf.png)






