当前位置:网站首页>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()
边栏推荐
- Thymeleaf 模板的创建与使用
- Install and configure Jenkins
- Long list optimized virtual scrolling
- Photoshop plug-in - action related concepts - actions in non loaded execution action files - PS plug-in development
- How to choose the appropriate certificate brand when applying for code signing certificate?
- CPU design related notes
- 长列表优化虚拟滚动
- Photoshop插件-动作相关概念-ActionList-ActionDescriptor-ActionList-动作执行加载调用删除-PS插件开发
- webRTC SDP mslabel lable
- 【学习笔记】阶段测试1
猜你喜欢

CPU设计相关笔记

Change multiple file names with one click

Security analysis of Web Architecture

选择排序和冒泡排序

如何将电脑复制的内容粘贴进MobaXterm?如何复制粘贴

Qingda KeYue rushes to the science and Innovation Board: the annual revenue is 200million, and it is proposed to raise 750million

Thymeleaf th:with use of local variables

一键更改多个文件名字

两个BI开发,3000多张报表?如何做的到?

Microframe technology won the "cloud tripod Award" at the global Cloud Computing Conference!
随机推荐
安装配置Jenkins
【C 题集】of Ⅷ
Change multiple file names with one click
危机重重下的企业发展,数字化转型到底是不是企业未来救星
Implement a blog system -- using template engine technology
js亮瞎你眼的日期选择器
Thymeleaf 常用函数
How does redis implement multiple zones?
超级哇塞的快排,你值得学会!
Explain Vue's plan to clean up keepalive cache in time
CPU设计实战-第四章实践任务二用阻塞技术解决相关引发的冲突
Catch all asynchronous artifact completable future
How to choose the appropriate certificate brand when applying for code signing certificate?
Niuke: intercepting missiles
Thymeleaf common functions
MongDB学习笔记
I collect multiple Oracle tables at the same time. After collecting for a while, I will report that Oracle's OGA memory is exceeded. Have you encountered it?
FR练习题目---综合题
想问下大家伙,有无是从腾讯云MYSQL同步到其他地方的呀?腾讯云MySQL存到COS上的binlog
用 Go 跑的更快:使用 Golang 为机器学习服务