当前位置:网站首页>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 are the most problematic database accounts in DTS?
- 小程序地理位置接口申请
- 支付宝上股票开户安全吗
- Unity & facegood audio2face drives face blendshape with audio
- OSI的体系结构,以及各层协议
- None of the most complete MySQL commands in history is applicable to work and interview (supreme Collection Edition)
- 巧妙使用sort(List<T>,Comparator<? super T>)比较器
- 731. My schedule II (segment tree or scoring array)
- OSI architecture and protocols at all levels
- How to design the order system in e-commerce projects? (supreme Collection Edition)
猜你喜欢
![[postgraduate entrance examination vocabulary training camp] day 12 - native, separate, figure, contribution, categories, assessment, propose](/img/6e/97e9335b7017e6e40d248252493e80.png)
[postgraduate entrance examination vocabulary training camp] day 12 - native, separate, figure, contribution, categories, assessment, propose

None of the most complete MySQL commands in history is applicable to work and interview (supreme Collection Edition)

运动控制卡应用开发教程之调用激光振镜控制
![[combination of classes (define a class in a class)]](/img/ae/a8226e1795bb45171a11c65d35bcac.png)
[combination of classes (define a class in a class)]

My love lesson 2 - remove webpage pop-up
![[e-commerce operation] teach you these tips to bid farewell to invalid preset replies](/img/5b/6682c613305deb3dc15401077d38a0.png)
[e-commerce operation] teach you these tips to bid farewell to invalid preset replies

Gather relevant knowledge points and expand supplements

Applet location interface application

How to realize three schemes of finclip wechat authorized login

RISC0:Towards a Unified Compilation Framework for Zero Knowledge
随机推荐
2022 Tsinghua summer school notes L2_ 1 basic composition of neural network
Drawing library matplotlibmatplotlib quick start
String matching (Huawei)
How to gracefully realize regular backup of MySQL database (glory Collection Edition)
小程序地理位置接口申请
Metauniverse: technological evolution, industrial ecology and big country game
[CCNA experiment sharing] routing between VLANs of layer 3 switches
Drawing library Matplotlib installation configuration
What is a self built database on ECs?
2018mysql technology Q & a collection, hoping to give some help to students who like MySQL
Makefile基础知识--扩展
Can bank financial products be redeemed and transferred out on the same day?
MySQL forced indexing
Mathpix formula extractor
实现redis哨兵,模拟master故障场景
运动控制卡应用开发教程之调用激光振镜控制
从A76到A78——在变化中学习ARM微架构
[blind box app mall system] function introduction after online unpacking
Gradle学习集合整合
[combination of classes (define a class in a class)]