当前位置:网站首页>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 ddddocr
Use
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
8342
summary
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
边栏推荐
- Global and Chinese medical protective clothing market supply and demand research and investment value proposal report 2022-2028
- An interview question record about where in MySQL
- No one reads the series. Source code analysis of copyonwritearraylist
- Es11 new methods: dynamic import(), bigint, globalthis, optional chain, and null value merging operator
- [Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security
- Fdisk command – disk partition
- Understand what ICMP Protocol is
- Ethernet
- Vegetables sklearn - xgboost (2)
- Monitoring access: how to grant minimum WMI access to the monitoring service account
猜你喜欢
Day21 performance test process
[speech discrimination] discrimination of speech signals based on MATLAB double threshold method [including Matlab source code 1720]
ctfshow-misc
Getting started with mongodb
MySQL tuning -- 02 -- slow query log
RT thread i/o device model and layering
Mongodb delete data
Notes on dashboard & kuboard installation in kubernetes cluster
What is the IP address
Soft exam information system project manager_ Management Science (Operations Research) 2--- senior information system project manager of soft test 034
随机推荐
Understand what MSS is
Why study discrete mathematics
证券如何在线开户?在线开户是安全么?
Monitoring access: how to grant minimum WMI access to the monitoring service account
Invalid bound statement (not found)
TFTP command – uploading and downloading files
Three tier architecture experiment
Soft exam information system project manager_ Management Science (Operations Research) -- senior information system project manager of soft test 033
[network security] sharing of experience and ideas of an emergency battle
[road of system analyst] collection of wrong questions in the chapters of Applied Mathematics and economic management
Go quiz: considerations for function naming return value from the go interview question (more than 80% of people answered wrong)
General test point ideas are summarized and shared, which can be directly used in interview and actual software testing
JD 7 head search navigation layout
The elephant turns around and starts the whole body. Ali pushes Maoxiang not only to Jingdong
Uname command – displays system information
Research Report on brand strategic management and marketing trends in the global and Chinese preserved fruit market 2022
delphi-UUID
Detailed explanation of @jsoninclude annotation in Jackson
[kicad image] download and installation
Rhcsa day 4