当前位置:网站首页>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 .)
边栏推荐
- What technical knowledge is needed to build a personal blog independently besides ECS?
- What is a database password?
- leetcode:不可能得到的最短骰子序列【思维题 + 分组思想】
- What should I pay attention to when choosing the self built database access method on ECs?
- 中移链(基于EOS)测试环境搭建
- 支付宝上股票开户安全吗
- Wechat applet monitoring real-time geographical location change event interface application
- Tencent +360+ Sogou school recruitment test + summary of knowledge points
- What are the most problematic database accounts in DTS?
- None of the most complete MySQL commands in history is applicable to work and interview (supreme Collection Edition)
猜你喜欢

Sqlserver BCP parameter interpretation, character format selection and fault handling summary

How to design the order system in e-commerce projects? (supreme Collection Edition)

Today, there's a power failure for one day.... stop working for another day. Don't forget to study

实现redis哨兵,模拟master故障场景

Feeding Program Source Code to ZK VMs

Machine learning kmeans

数据库之-元数据 DatabaseMetaData 初学

rogabet note 1.1
![Mathematical derivation in [pumpkin Book ml] (task4) neural network](/img/11/8d0f7254c2a22d46f2407b5f773c5c.png)
Mathematical derivation in [pumpkin Book ml] (task4) neural network

运动控制如何位置同步输出
随机推荐
《论文复现》BiDAF代码实现过程(4)模型训练+验证
吾爱第二课-去除网页弹窗
[crawler knowledge] better than lxml and BS4? Use of parser
Gradle 学习 ----Gradle 入门
91. (leaflet chapter) leaflet situation plotting - offensive direction drawing
[pyspark foundation] row to column and column to row (when there are more than one column)
Wechat applet monitoring real-time geographical location change event interface application
Image processing notes (1) image enhancement
MySQL - multi table query - seven join implementations, set operations, multi table query exercises
2022 Tsinghua summer school notes L1_ NLP and bigmodel Foundation
[verification of ID number]
[combination of classes (define a class in a class)]
中信证券股票开户怎么样安全吗
Which type of database migration is suitable for choosing the self built database access method on ECs?
Gradle learning - integration of gradle and idea
中移链(基于EOS)测试环境搭建
Calling Laser Galvanometer control in the application and development tutorial of motion control card
OSI的体系结构,以及各层协议
2022 Tsinghua summer school notes L2_ 1 basic composition of neural network
【考研词汇训练营】Day 12 —— native,separate,figure,contribute,species,assumption,suppose