当前位置:网站首页>easyOCR 字符識別
easyOCR 字符識別
2022-07-05 14:45: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()
边栏推荐
- 选择排序和冒泡排序
- 一键更改多个文件名字
- Sharing the 12 most commonly used regular expressions can solve most of your problems
- Drive brushless DC motor based on Ti drv10970
- Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection
- Topology visual drawing engine
- mysql8.0JSON_ Instructions for using contains
- Share 20 strange JS expressions and see how many correct answers you can get
- NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
- Isn't it right to put money into the external market? How can we ensure safety?
猜你喜欢
PyTorch二分类时BCELoss,CrossEntropyLoss,Sigmoid等的选择和使用
黑马程序员-软件测试-10阶段2-linux和数据库-44-57为什么学习数据库,数据库分类关系型数据库的说明Navicat操作数据的说明,Navicat操作数据库连接说明,Navicat的基本使用,
【NVMe2.0b 14-9】NVMe SR-IOV
一键更改多个文件名字
Countermeasures of enterprise supply chain management system in UCA Era
Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
面试突击62:group by 有哪些注意事项?
LeetCode_ 2 (add two numbers)
729. 我的日程安排表 I :「模拟」&「线段树(动态开点)」&「分块 + 位运算(分桶)」
How to protect user privacy without password authentication?
随机推荐
在Pytorch中使用Tensorboard可视化训练过程
How to choose the appropriate certificate brand when applying for code signing certificate?
Is the securities account given by the head teacher of qiniu school safe? Can I open an account?
Strong connection component
Qingda KeYue rushes to the science and Innovation Board: the annual revenue is 200million, and it is proposed to raise 750million
CYCA少儿形体礼仪 宁波市培训成果考核圆满落幕
js亮瞎你眼的日期选择器
Security analysis of Web Architecture
Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment
长列表优化虚拟滚动
快消品行业SaaS多租户解决方案,构建全产业链数字化营销竞争力
Explain Vue's plan to clean up keepalive cache in time
Countermeasures of enterprise supply chain management system in UCA Era
World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection
How can non-technical departments participate in Devops?
直播预告|如何借助自动化工具落地DevOps(文末福利)
周大福践行「百周年承诺」,真诚服务推动绿色环保
Two policemen were shot dead in a "safety accident" in Philadelphia, USA
Thymeleaf th:with use of local variables
How to solve the problem of garbled code when installing dependency through NPM or yarn