QR Code Recognition Example
HUSKYLENS 2 QR blocks let Mind+ users detect, count and filter QR codes by ID, then read name, content, size and center coordinates in each frame; it’s like giving your robot eyes plus a label reader so it can react to specific tags.
1.QR Code Recognition Blocks
Before You Start:
1.1 QR Code Recognition - Output Relevant Data
HUSKYLENS 2 can recognize QR codes appearing in the frame. You can get data about detected QR codes through programming. Readable QR code data includes: the total number of detected QR codes, and data for a specific QR code, including its ID, Content, Width, Height, and X/Y coordinates of the center point.
Example Program:
Click to upload the program to the device in Mind+, and wait for the upload to complete.
Point the HuskyLens 2 camera at the QR code in the frame to learn it. For detailed instructions on how to learn QR codes, refer to: QR Code Recognition.
Point the HUSKYLENS 2 camera at the QR code and observe the results displayed on the UNIHIKER K10 screen.
Output Result: As shown, it can output the number of detected QR codes (whether learned or not) and the specified QR code ID. Unlearned QR codes have an ID of 0.
1.2 Get Data for a Specific QR Code in the Frame
After HuskyLens 2 recognizes QR codes, it can acquire data for a specific QR code in the frame. For example, it can determine if a QR code with a specific ID is in the frame, get the count of QR codes with the same ID, and when multiple QR codes with the same ID appear, it can be set to acquire parameters for a specific one, including Name, Content, X/Y coordinates, Width, and Height.
Example Program:
Output Result: As shown, there are two unlearned QR codes (ID 0) in the frame. The first ID 0 QR code is on the right, and its content is 'DFROBOT' (Pumpkin Bread). The second ID 0 QR code is on the left, and its coordinates are (245,251).
1.3 QR Reconition Blocks Description
| block | Description |
|---|---|
|
Acquire QR code recognition data once. |
|
Determine if any tag is detected. |
|
Get data of the closest QR code: ID, name, center X/Y coordinates, width, height, decoded content. |
|
Get total number of detected QR codes, including unlearned and learned QR codes. |
|
Get the number of QR codes that have been learned by HuskyLens 2, regardless of whether they appear in the current frame. |
|
Get data of a specified QR code. |
|
Determine whether a specified ID exists. |
|
Get number of QR codes with a specified ID. |
|
Get data of QR codes with a specified ID. |
|
Get data of one specified QR code when multiple shares the same ID. |
Was this article helpful?
