当前位置:网站首页>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

边栏推荐
- Lesson 8: FTP server setup and loading
- Guess the size of the number
- MV command – move or rename files
- Analysis report on global and Chinese pharmaceutical excipients industry competition and marketing model 2022-2028
- JD 7 head search navigation layout
- IQ debugging of Hisilicon platform ISP and image (1)
- Copying DNA
- Cat command – display the file contents on the terminal device
- Research Report on global and Chinese vaccine market profit forecast and the 14th five year plan development strategy 2022-2028
- [kicad image] download and installation
猜你喜欢

What is the slice flag bit

After five years of software testing in ByteDance, I was dismissed in December to remind my brother of paddling

JSON. toJSONString(object, SerializerFeature.WriteMapNullValue); Second parameter action

3-7sql injection website instance step 3: attack type and attack strategy

Click to send text messages without response is a common problem for many users in building the elegant grass Dragonfly Q system - solve the problem of clicking to send text messages without response
[interview with a large factory] meituan had two meetings. Was there a surprise in the end?

Hands on deep learning (III)

Face++ realizes face detection by flow
![[network security] sharing of experience and ideas of an emergency battle](/img/9b/dd6e47ad7610eefd2b8c93602d6a7e.jpg)
[network security] sharing of experience and ideas of an emergency battle

CTFSHOW
随机推荐
Mongodb basic concept learning - set
Research Report on brand strategic management and marketing trends in the global and Chinese preserved fruit market 2022
Getting started with Silverlight development 1
Gb28181 protocol -- timing
China rehabilitation hospital industry operation benefit analysis and operation situation investigation report 2022
Personal blog system graduation project opening report
Highway
Go uses channel to control concurrency
Count the grid
Interview experience - list of questions
MySQL tuning --01--- optimization steps and system performance parameters
Monitoring access: how to grant minimum WMI access to the monitoring service account
Fdisk command – disk partition
Laravel8 fill data
Arm register (cortex-a), coprocessor and pipeline
Methods for obtaining some information of equipment
[v2.0] automatic update system based on motion step API (support disconnection reconnection and data compensation)
ctfshow-misc
MV command – move or rename files
Ethernet