QR Code Recognition Example

HuskyLens 2 QR blocks let Mind+ read, count and filter QR codes in view, like sorting labeled boxes on a shelf; you can detect any tag, get total and learned counts, then query closest or specific IDs for position, size and decoded content.

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, the total number of learned 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:

Interface Diagram

Click 'Run' in Mind+ and wait for the program to upload.

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 M10 screen.

Output Result: As shown, it can output the number of detected QR codes (whether learned or not), the number of learned QR codes, and the specified QR code ID. Unlearned QR codes have an ID of 0.

Interface Diagram

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:

Interface Diagram

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 'abc' . The second ID 0 QR code is on the left, and its coordinates are (188, 150).

Interface Diagram

18.3 QR Code Recognition 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?

TOP