当前位置:网站首页>With a younger brother OCR, say no to various types of verification codes!
With a younger brother OCR, say no to various types of verification codes!
2022-06-25 06:24:00 【Python Technology】

writing | So and so white rice
source :Python technology 「ID: pythonall」


install
Will automatically install the latest software that conforms to your computer environment ddddocr.Python Environment needs to be less than or equal to 3.9.
pip install ddddocrUse
Take your brother OCR Three verification codes can be identified , Xiaobian will experiment with these three methods .
Slider verification code
Slider verification code here is the slider verification of Douban . The lower slider is a separate transparent background hycdn.png.

The background image is a pit with a small slider background.jpg.

import ddddocr
det = ddddocr.DdddOcr(det=False, ocr=False)
with open('hycdn.png', 'rb') as f:
target_bytes = f.read()
with open('background.jpg', 'rb') as f:
background_bytes = f.read()
res = det.slide_match(target_bytes, background_bytes, simple_target=True)
print(res)Recognition result
{'target_y': 0, 'target': [486, 126, 622, 262]}target The first two values of the attribute coincide with the Douban validation slider url Submitted in ans almost .

Click the class verification code
Click the type verification code to use Netease login

det = ddddocr.DdddOcr(det=True)
with open("eb.jpg", 'rb') as f:
image = f.read()
poses = det.detection(image)
im = cv2.imread("eb.jpg")
for box in poses:
x1, y1, x2, y2 = box
im = cv2.rectangle(im, (x1, y1), (x2, y2), color=(0, 0, 255), thickness=2)
cv2.imwrite("result.jpg", im)Recognition result

Alphanumeric verification code
The picture of alphanumeric verification code comes from google Search for

ocr = ddddocr.DdddOcr(old=True)
with open("z1.jpg", 'rb') as f:
image = f.read()
res = ocr.classification(image)
print(res)Recognition result
3n3d
8342summary
ddddocr Make the verification code so simple and easy to use ,, It won't work opencv, pytorch, tensorflow Our little partner can also quickly crack the login verification code of the website . If you have other good friends ocr Recognition can also be shared in messages .
PS: Reply within company number 「Python」 You can enter Python Novice learning communication group , Together 100 Day plan !
Old rules , Brothers, remember , Right lower corner “ Looking at ” click , If you think the content of the article is good , Remember to share the circle of friends and let more people know !

【 Code Access method 】
Identify the QR code at the end of the text , reply : So and so white rice

边栏推荐
- PHP and WMI – explore windows with PHP
- Distributed solar photovoltaic inverter monitoring
- Handling skills of SQL optimization (2)
- [hand torn STL] Stack & queue
- A + B Again
- BGP - basic concept
- BigDecimal. Summary of setscale usage
- Tablespace free space
- Analysis report on investment and financing status and operation benefits of global and Chinese dental industry (2022 Edition)
- Vegetables sklearn - xgboost (2)
猜你喜欢

Wechat applet authorization login + mobile phone sending verification code +jwt verification interface (laravel8+php)
![[kicad image] download and installation](/img/88/cebf8cc55cb8904c91f9096312859a.jpg)
[kicad image] download and installation

Understand what MTU is

Personal blog system graduation project opening report

Getting started with Silverlight development 1

Soft exam information system project manager_ Information system security management - Senior Information System Project Manager of soft test 026
![[road of system analyst] collection of wrong questions in the chapters of Applied Mathematics and economic management](/img/62/dab2ac0526795f2040394acd9efdd3.jpg)
[road of system analyst] collection of wrong questions in the chapters of Applied Mathematics and economic management

Gb28181 protocol -- timing

BGP - basic concept
The e-book "action guide for large organizations to further promote zero code application platform" was officially released!
随机推荐
Ethernet
An easy problem
[kicad image] download and installation
Pre knowledge of asynchronous operation
What does cardinality mean in set
Go quiz: considerations for function naming return value from the go interview question (more than 80% of people answered wrong)
China rehabilitation hospital industry operation benefit analysis and operation situation investigation report 2022
Day21 JMeter usage basis
The e-book "action guide for large organizations to further promote zero code application platform" was officially released!
Handling skills of SQL optimization (2)
【LeetCode】40. Combined summation II (2 strokes of wrong questions)
Soft exam information system project manager_ Management Science (Operations Research) -- senior information system project manager of soft test 033
Notes on dashboard & kuboard installation in kubernetes cluster
A + B Again
Face++ realizes face detection by flow
Tablespace free space
Research Report on brand strategic management and marketing trends in the global and Chinese preserved fruit market 2022
Analysis report on production and sales demand and sales prospect of global and Chinese phosphating solution Market 2022-2028
What are the reasons why most webmasters choose Hong Kong site group servers?
MV command – move or rename files