当前位置:网站首页>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()
边栏推荐
- [detailed explanation of Huawei machine test] happy weekend
- IPv6与IPv4的区别 网信办等三部推进IPv6规模部署
- dynamic programming
- Longest common subsequence dynamic programming
- Handwriting promise and async await
- CPU设计实战-第四章实践任务三用前递技术解决相关引发的冲突
- leetcode:881. lifeboat
- What about SSL certificate errors? Solutions to common SSL certificate errors in browsers
- 注意!软件供应链安全挑战持续升级
- FR练习题目---综合题
猜你喜欢
Loop invariant
729. My schedule I: "simulation" & "line segment tree (dynamic open point) &" block + bit operation (bucket Division) "
Solution of commercial supply chain collaboration platform in household appliance industry: lean supply chain system management, boosting enterprise intelligent manufacturing upgrading
分享 20 个稀奇古怪的 JS 表达式,看看你能答对多少
leetcode:881. lifeboat
SaaS multi tenant solution for FMCG industry to build digital marketing competitiveness of the whole industry chain
Section - left closed right open
微帧科技荣获全球云计算大会“云鼎奖”!
选择排序和冒泡排序
LeetCode_ 2 (add two numbers)
随机推荐
在Pytorch中使用Tensorboard可视化训练过程
两个BI开发,3000多张报表?如何做的到?
useMemo,memo,useRef等相关hooks详解
Two policemen were shot dead in a "safety accident" in Philadelphia, USA
详解Vue适时清理keepalive缓存方案
世界环境日 | 周大福用心服务推动减碳环保
MongDB学习笔记
面试突击62:group by 有哪些注意事项?
Security analysis of Web Architecture
Structure - C language
Mysql database installation tutorial under Linux
Topology可视化绘图引擎
How to make a second clip of our media video without infringement
Online electronic component purchasing Mall: break the problem of information asymmetry in the purchasing process, and enable enterprises to effectively coordinate management
周大福践行「百周年承诺」,真诚服务推动绿色环保
leetcode:881. lifeboat
How can non-technical departments participate in Devops?
[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)
Change multiple file names with one click
There is a powerful and good-looking language bird editor, which is better than typora and developed by Alibaba