当前位置:网站首页>Maixll dock QR code recognition
Maixll dock QR code recognition
2022-07-24 22:02:00 【Salted fish shell】
Maixll-Dock QR code recognition
I don't need to say more about QR code recognition
Salted fish products , Just use it. ~
Choose version :v831-m2dock-maixpy3-0.5.0-20220601
Two dimensional bar code / QR code (2-dimensional bar code)
Use a specific geometric figure to move on the plane according to a certain law ( Two dimensional ) Distributed black and white graphics record data symbol information ; A number of geometric shapes corresponding to binary are used to represent literal numerical information , Through image input device or photoelectric scanning device to read automatically to achieve automatic information processing :
It has some common features of bar code technology :
- Each code system has its own specific character set ; Each character has a certain width ; It has certain verification function, etc .
- At the same time, it also has the function of automatic identification of different information 、 And processing the rotation change point of the graph .
image modular :find_qrcodes
One 、 The import module
from maix import image
Two 、 Basic usage
from maix import image
x=image.find_qrcodes()
print(x)
Get the outline coordinates : Read find_qrcodes() The key value in the dictionary returned by the function is : x , y , w , h The value of is used as the coordinate information of the outline of the QR code ( Blue box ). > Get the coordinates of the inner frame : Read find_qrcodes() The key value in the dictionary returned by the function is : corners The values in the list of are used as the coordinates of the inner box of the QR code ( Green box ).
Get QR code information : Read find_qrcodes() The key value in the dictionary returned by the function is : payload As QR code information .
The key values of the dictionary are as follows :‘x’ , ‘y’ , ‘w’ , ‘h’ , ‘payload’ , ‘version’ , ‘ecc_level’ , ‘mask’ , ‘data_type’ , ‘eci’ , ‘corners’.
| Key value | explain |
|---|---|
| x | Returns the bounding box of the QR code x coordinate (int). |
| y | Returns the bounding box of the QR code y coordinate (int). |
| w | Returns the bounding box of the QR code w coordinate (int). |
| h | Returns the bounding box of the QR code h coordinate (int). |
| payload | Returns the string of QR code payload , for example URL . |
| version | Returns the version number of the QR code (int). |
| ecc_level | Return QR code ECC level (int). |
| mask | Returns the mask of the QR code (int). |
| data_type | Return the data type of QR code |
| eci | Return QR code ECI.ECI Stored QR The code in which data bytes are stored . |
| qrcode.corners | Returns a four tuple consisting of the four corners of the object (x,y) A list of . The four corners are usually returned clockwise from the upper left corner . |
Case study : Identify QR code
see find_qrcodes() Return information
from maix import display, camera
while True:
t = camera.capture()
mks = t.find_qrcodes()
print(mks) # Output information
display.show(t)
The information obtained is as follows : It's a dictionary
[{‘x’: 49, ‘y’: 41, ‘w’: 168, ‘h’: 160, ‘payload’: ‘xianyujun’, ‘version’: 1, ‘ecc_level’: 3, ‘mask’: 1, ‘data_type’: 4, ‘eci’: 0, ‘corners’: [[49, 52], [211, 41], [217, 201], [69, 196]]}]

After getting the dictionary, we will understand the following code .
Identify QR code
from maix import display, camera
while True:
t = camera.capture()
mks = t.find_qrcodes()
for mk in mks:
# Outline data
X = mk['x']
Y = mk['y']
W = mk['w']
H = mk['h']
# QR code information
string = mk['payload']
# Inner frame data
x1,y1 = mk['corners'][0] # Access the list of dictionaries
x2,y2 = mk['corners'][1]
x3,y3 = mk['corners'][2]
x4,y4 = mk['corners'][3]
# Draw frame
t.draw_rectangle(X, Y, X + W, Y + H, color=(0, 0, 255), thickness = 2)
# Print information
t.draw_string(int(X) , int(Y - 35) , str(string), scale = 2.0, color = (255, 0, 0), thickness = 2) # Inner frame ID
# Draw the inner frame
t.draw_line(x1, y1, x2, y2, color = (0, 255, 0), thickness = 3)
t.draw_line(x2, y2, x3, y3, color = (0, 255, 0), thickness = 3)
t.draw_line(x3, y3, x4, y4, color = (0, 255, 0), thickness = 3)
t.draw_line(x4, y4, x1, y1, color = (0, 255, 0), thickness = 3)
display.show(t)
design sketch :( Can't recognize complex QR code , The gorgeous one doesn't work .)
边栏推荐
- CAD calls mobile command (COM interface)
- Can bank financial products be redeemed and transferred out on the same day?
- Dtable launched in the public beta, which is not only a table, but also a business application builder
- Maxcompute instance related operations
- Everything about database, database and table is here
- Alibaba cloud and parallel cloud launched the cloud XR platform to support the rapid landing of immersive experience applications
- Binary search
- Diou and ciou loss of loss function
- Shallow copy deep copy
- Understand MySQL index and b+tree in an easy to understand way (supreme Collection Edition)
猜你喜欢

运动控制如何位置同步输出

Unity & facegood audio2face drives face blendshape with audio

Gradle 学习 ----Gradle 进阶说明
![Mathematical derivation in [pumpkin Book ml] (task4) neural network](/img/11/8d0f7254c2a22d46f2407b5f773c5c.png)
Mathematical derivation in [pumpkin Book ml] (task4) neural network

数据库之-元数据 DatabaseMetaData 初学

With this PDF, I successfully got offers from ant, jd.com, Xiaomi, Tencent and other major manufacturers
![[blind box app mall system] function introduction after online unpacking](/img/c9/3d13409113a3671555c4744eeb3913.jpg)
[blind box app mall system] function introduction after online unpacking

陈春花与莫言,都有苦难言

Everything about database, database and table is here
![[postgraduate entrance examination English vocabulary training camp] day 11 - offer, form, maintain, critical](/img/49/360222c3528ee527b4ca659b0ec669.png)
[postgraduate entrance examination English vocabulary training camp] day 11 - offer, form, maintain, critical
随机推荐
Build Tencent cloud website server at low cost (build your own website server)
MySQL - multi table query - seven join implementations, set operations, multi table query exercises
Jenkins introduction
2022 Tsinghua summer school notes L1_ NLP and bigmodel Foundation
Diou and ciou loss of loss function
微信小程序监听实时地理位置变化事件接口申请
[Development Tutorial 4] open source Bluetooth heart rate waterproof sports Bracelet - external flash reading and writing
中移链(基于EOS)测试环境搭建
Deep understanding of affairs
一种自动化九点标定工具原理(包涵部分源码)
Alibaba cloud and parallel cloud launched the cloud XR platform to support the rapid landing of immersive experience applications
[image processing] pyefd.elliptic_ fourier_ How descriptors are used
C # review the entrustment and event
RISC0:Towards a Unified Compilation Framework for Zero Knowledge
Leetcode: the shortest dice sequence impossible to get [thinking questions + grouping ideas]
ESP32C3 LED PWM使用和ESP32差异说明
Sqlserver BCP parameter interpretation, character format selection and fault handling summary
C# 回看委托与事件
运动控制卡应用开发教程之调用激光振镜控制
2022 Niuke multi school 7.23