当前位置:网站首页>5 lines of code identify various verification codes
5 lines of code identify various verification codes
2022-06-12 07:12:00 【Snow falls on the devil's land】
A group friend shared a new library , Try it and find it very practical , I want to share it with you today .
Github Address :https://github.com/sml2h3/ddddocr
The library name is also very interesting —— ddddocr( Homophonic band OCR)
Environmental requirements :
python >= 3.8
Windows/Linux/Macox..
You can install it with the following command
pip install ddddocr
Parameter description :

I randomly looked for a verification code picture on the Internet , Use this library to practice .

source : Baidu search
import ddddocr
ocr = ddddocr.DdddOcr()
with open('1.png', 'rb') as f:
img_bytes = f.read()
res = ocr.classification(img_bytes)
print(res)

Successfully recognized the verification code text !
And the advantages are also very obvious : First of all, the code is very concise , Compare the two methods mentioned above , There is no need to set additional environment variables, etc ,5 One line of code can easily identify the verification code picture . On the other hand , We use magic commands %%time Did you test it , This code recognition speed is very fast .
Let's continue the test with more verification code pictures :

I looked for it again 6 A verification code picture to test , Observations , It is found that this kind of simple verification code can be recognized quickly . But some of the results are problematic —— Letters are not case sensitive ( For example 6 A picture ).
To make a long story short , If you need verification code identification , And the accuracy requirement is not too high .
that , Take your brother OCR(ddddocr) This library is a good choice ~
边栏推荐
- Recommend 17 "wheels" to improve development efficiency
- Imx6q pwm3 modify duty cycle
- Android studio uses database to realize login and registration interface function
- Scons compiling imgui
- Day 5 of pyhon
- 【高考那些事】准大学生看过来,选择方向和未来,自己把握
- NOI openjudge 计算2的N次方
- D
- [Li Kou] curriculum series
- Can official account also bring goods?
猜你喜欢

The second revolution of reporting tools

ROS dynamic parameter configuration: use of dynparam command line tool (example + code)
![[image denoising] image denoising based on partial differential equation (PDE) with matlab code](/img/65/f8617beb05e163bd5f7dbade99a4a1.png)
[image denoising] image denoising based on partial differential equation (PDE) with matlab code

Imx6q PWM drive

sql server 2019安装出现错误,如何解决

Dynamic coordinate transformation in ROS (dynamic parameter adjustment + dynamic coordinate transformation)

【数据聚类】本专栏中涉及数据集、可视化及注意事项

Demonstrate "topic communication, action communication, service communication and parameter server" with a small turtle case

Pyhon的第四天

1. Foundation of MySQL database (1- installation and basic operation)
随机推荐
sql server2019安装到这步无法进行下一步了,如何解决?
“我被大厂裁员了”
[Li Kou] curriculum series
Node, topic, parameter renaming and global, relative and private namespaces in ROS (example + code)
sql——课程实验考查
Database syntax related problems, solve a correct syntax
【图像去噪】基于非局部欧几里德中值 (NLEM) 实现图像去噪附matlab代码
[image denoising] image denoising based on partial differential equation (PDE) with matlab code
sql server 2019安装出现错误,如何解决
descheduler 二次调度让 Kubernetes 负载更均衡
Kali and programming: how to quickly build the OWASP website security test range?
LED lighting experiment with simulation software proteus
Pyhon的第四天
New knowledge: monkey improved app crawler
How to update kubernetes certificates
d中的解耦
The second revolution of reporting tools
Detailed explanation of convirt paper (medical pictures)
android studio 利用数据库实现登录注册界面功能
Noi openjudge computes the n-th power of 2