1.Hardware and Software Description

1.1 Introduction to Mind+

Mind+ is a youth-oriented programming software based on Scratch3.0. It supports graphical and code-based programming for various open-source hardware including Arduino, UNIHIKER K10, and UNIHIKER M10. Users can simply drag and drop graphical blocks to complete programming tasks. Additionally, it allows the use of advanced programming languages such as Python, C, and C++, enabling everyone to enjoy the joy of creating.

Please download the latest version of Mind+ from the official website: https://mindplus.cc.

Introduction to DFRobot Arduino Uno R3

DFRduino UNO R3 is an open-source Simple I/O platform with a development environment similar to Java and C languages. It allows you to quickly create interactive projects using Arduino language, along with software like Flash and Processing.
Purchase link: https://www.dfrobot.com/product-838.html

2.Hardware Connection

  • Hardware
    • DFRduino UNO R3 (or similar mainboard) x1
    • USB Cable A-B for Arduino Uno x1
    • HUSKYLENS 2 x1
    • USB data cable x1
    • 4pin connecting cable x1

Connect the HUSKYLENS 2 to the corresponding I2C pins of the Arduino mainboard and connect the Arduino Uno to the computer using the power cable. Additional power supply reminder: The voltage output by the I2C pins of Arduino Uno is insufficient to support the normal operation of HUSKYLENS 2. When connecting HUSKYLENS 2 to Arduino Uno, an additional data cable must be used to connect the Type-C interface of HUSKYLENS 2 to the power supply for additional power. The wiring diagram can be referred to in the following figure.

Interface Diagram

3. Load the HUSKYLENS 2 library

Double-click to open Mind+. After opening, locate "Upload" and click to select it

Interface Diagram

Wait for the upload mode initialization to complete, click "Extensions" in the lower-left corner. For the first use, you need to download the corresponding main controller extension library. Find "Arduino Uno" and click the "Download" button in the upper-right corner to download the library.Once the Arduino Uno expansion pack has finished downloading, click "Load Arduino Uno Expansion Pack". After successfully loading, it will look like the following image.

Interface Diagram

Click 'Module ', search for 'HUSKYLENS 2' in the module extensions list, find the HUSKYLENS 2 extension library, and click to download.After successful download, click to load the HUSKYLENS 2 library.

Interface Diagram

4.Face Recognition Block

Under Face Recognition mode, when a human face appears on the HUSKYLENS 2 display, it can be detected and boxed. We can obtain the relevant data of the human face closest to the cross cursor in the HUSKYLENS 2 display and print this data via UART. The readable face data includes: face ID, face name, width, height, as well as the X and Y coordinates of the face center.
The example program is as follows.

Interface Diagram

In Mind+, click "Upload to Device" and wait for the program to finish uploading. Then, tap the touchscreen to access the Face Recognition feature in HUSKYLENS 2.

Interface Diagram

Point the HUSKYLENS 2 camera at a face, open the serial port in Mind+, and observe the output.

**Result: ** For unlearned faces, the default output ID is 0.

Interface Diagram

You can aim the camera at a learned face. For detailed instructions on how to learn a face, please refer to: : HUSKYLENS 2 WIKI

** Result: ** As follows, for a learned face, the output ID will be consistent with the ID displayed on the HUSKYLENS 2 screen.

Interface Diagram

4.2 Count faces and output the specified face data.

When multiple faces appear in the frame, use the following example program to count the number of faces and obtain relevant data for the face with a specified ID.
The example program is as follows.

Interface Diagram

** Result: ** As shown in the figure, run the program, and the serial port will print the number of faces in the current image. When a face with ID 1 appears, it will print the relevant data for face ID 1.

Interface Diagram

** Result: ** As shown in the figure below. When the program runs, if a face with ID 1 is not detected, the serial port will only output the current number of faces.

Interface Diagram

4.3 Face Recognition Blocks Description

block Description
Used to obtain one set of Face Recognition data under the Face Recognition function of HUSKYLENS 2.
Determine if a human face is present in the current frame.
Obtain relevant data of the human face nearest to the screen crosshair, including the face's ID, custom face name, center X coordinate, center Y coordinate, width, and height.
Get the total number of faces detected on the screen, including both unregistered and registered faces.
Obtain the relevant data of a specified face when multiple faces appear.
Determine if a face with the specified ID exists in the frame. Unlearned IDs are uniformly set to 0, and learned IDs are sorted in the order they were learned.
Gets the total number of detected faces with a specified ID on the screen.
Obtain the number of faces with the specified ID in the current frame.
When multiple faces are detected, retrieve the relevant data of a specified face.

5. Object Recognition Blocks

5.1 Object Recognition outputs relevant data.

In the Object Recognition function, HUSKYLENS 2 can recognize objects within its field of view (covering 80 fixed categories). It prints the related data through the serial port, including the total number of recognizable objects in the frame, the ID number of the object closest to the center of the HUSKYLENS 2 camera view, and the first detected object.

The example program is as follows.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete.Use the touchscreen to enter the Object Recognition function of HUSKYLENS 2.

Interface Diagram

Point the HUSKYLENS 2 camera at the objects in the frame to learn them one by one. For detailed learning steps, ; read HUSKYLENS 2 WIKI

After learning is complete, open the serial port in Mind+ and observe the output results.

**Result: ** The output includes the total number of recognized objects and the corresponding object ID numbers as required.

Interface Diagram

5.2 Obtain Data of Specified Object in Image

After HUSKYLENS 2 recognizes objects, you can obtain data of a specific object in the frame. For example, determine whether a learned object is present in the frame, identify the name of a specified object, or obtain the number of similar objects in the frame. When multiple similar objects appear, you can specify one object to get its related parameters, including name, X/Y coordinates, width, and height.

Example program is as follows:

Interface Diagram

Result: As shown in the figure, you can obtain the total number of objects in the frame, the number and name of ID2 objects, and the coordinate position of the first detected ID2 object.

 <p align="center">

Interface Diagram

5.3 Object Recognition Blocks Description

block> description
Used to obtain one set of object recognition data under the Object Recognition function of HUSKYLENS 2.
Determines whether there are recognizable objects in the current frame.
Obtains data for the object closest to the crosshair on the screen, including object ID, name, center X coordinate, center Y coordinate, width, and height.
Gets the number of all detectable objects in the screen.
When multiple recognizable objects appear,,obtains the relevant data of a specified object.
Determines whether an object with a specified ID exists in the frame. (After HUSKYLENS 2 learns objects, it assigns ID numbers according to the learning order.)
Obtains the number of objects with the specified ID in the current frame.
Obtains the related data of a specified object.
When multiple similar objects appear,obtains the related data of a specified object.

6.Object Tracking Blocks

6.1 Object Tracking Output Data

When HUSKYLENS 2 detects a trackable target, it can obtain related tracking data and print it through the serial port. The readable data includes object ID, name, XY coordinates, width, and height.
Example program is as follows.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete.
Use the touch screen to enter the Object Tracking function of HUSKYLENS .

Interface Diagram

Point the HUSKYLENS 2 camera at the object to be tracked (the target must be selected first). After the target is selected, open the serial port in Mind+ and observe the output.

**Result: ** The tracked object’s ID, name, XY coordinates, width, and height can be output. The default name of the tracked object is “track.” To modify the name, refer to HUSKYLENS 2 WIKI.

Interface Diagram

6.2 Object Tracking Blocks Description

block description
Used to obtain one set of Object Tracking data under the Object Tracking function of HUSKYLENS 2.
Determines whether there is a trackable target in the current frame.
Determines whether there is a trackable target in the current frame.

7. Color Recognition block

7.1 Color Recognition Outputs Data

HUSKYLENS 2 can recognize color blocks within its field of view and print related data through the serial port. The readable data include the ID of the color block closest to the center of the HUSKYLENS 2 camera, the total number of detected color blocks, and the ID of the first detected color block.

The sample program is shown below.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete.Use the touchscreen to enter the Color Recognition function of HUSKYLENS 2.

Interface Diagram

Align the crosshair of HUSKYLENS 2 with the color block in the image to start learning. For detailed instructions, read HUSKYLENS 2 Wiki.

After the learning process is complete, open the serial port in Mind+ and observe the output results.

Result: The output includes the total number of detected color blocks. Regardless of whether a color has been learned, any framed color block will be counted. The corresponding color block ID numbers can be displayed as required. The color block nearest to the center is outlined with a white frame, representing an unlearned color, therefore its ID is 0.

Interface Diagram

7.2 Obtain Data of Specified Color

After HUSKYLENS 2 recognizes colors, it can obtain the data of specified colors in the image. For example, determine whether a learned color appears in the frame, get its name, or obtain the number of color blocks of the same color. When multiple blocks of the same color appear, you can specify one to retrieve parameters such as name, X/Y coordinates, width, and height.

The sample program is shown below:

Interface Diagram

Result: As shown in the figure, you can obtain the total number and name of color blocks with ID1, as well as the coordinates of the first detected ID1 color block. (The color name can be customized; the default name is “Color”.)

Interface Diagram

7.3 Color Recognition Description

block description
Used to obtain one set of color recognition data in the Color Recognition function of HUSKYLENS 2.
Determines whether recognizable color blocks exist in the current frame.
Obtains data for the color block closest to the crosshair on the screen, including ID, name, center X/Y coordinates, width, and height.
Gets the total number of detected color blocks in the screen.
When multiple color blocks are detected, obtains the data of a specified block. (If the block is unlearned, its ID is 0.)
Determines whether a color with a specified ID exists in the image. (After HUSKYLENS 2 learns colors, IDs are assigned sequentially.)
Obtains the number of color blocks for a learned color in the current frame.
Obtains the data of a learned color.
When multiple color blocks of the same color appear, obtains the data of a specified block.

8.Self-Learning Classification Blocks

8.1 Recognize Learned Object and Output ID & Name

In the self-Learning Classification function, HUSKYLENS 2 can learn any custom object and recognize it after training. For more details, refer to HUSKYLENS 2 Wiki

Once an object has been learned, HUSKYLENS 2 can recognize it when it appears again. The following sample program can be used to obtain the ID and name of the recognized object.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete. Then use the touchscreen to enter the self-Learning Classification function of HUSKYLENS 2.

Interface Diagram

**Result: ** If a learned object has a custom name, the name output via the serial port matches the name displayed on the HUSKYLENS 2 screen

Interface Diagram

8.2 Self-Learning Classification Blocks Description

block description
Used to obtain one recognition result of a learned object under the Self-Learning function of HUSKYLENS 2. 。
Determines whether a previously learned object has been detected.
Obtains the related data of a learned object, including its ID and name. IDs start from 1 in learning order. If no custom name is set, the default is “Object.” If customized, the name matches the one shown on the HUSKYLENS 2 screen.

9.Gesture Recognition blocks

9.1 Gesture Recognition Output Data

HUSKYLENS 2 can detect gestures within its field of view and print related data through the serial port. The readable data includes the ID of the gesture closest to the camera center, the total number of detected gestures, and the ID of the first detected gesture.

The sample program is shown below.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete.Use the touchscreen to enter the Gesture Recognition function of HUSKYLENS 2. Aim the camera at gestures in the frame to learn them individually. For detailed steps, see HUSKYLENS 2 Wiki.

Interface Diagram

After the learning process is complete, open the serial port in Mind+ and observe the output results.

Result: The output includes the total number of detected gestures. Regardless of whether a gesture has been learned, it will be counted once detected (a framed box indicates detection). Learned gestures are assigned IDs sequentially, while unlearned gestures have an ID of 0.

Interface Diagram

9.2 Obtain Data of Specified Gesture

After HUSKYLENS 2 recognizes gestures, you can obtain the data of a specified gesture. For example, check whether a learned gesture appears in the frame, gets its name, or obtains the number of identical gestures. When multiple gestures of the same type appear, you can specify one gesture to retrieve parameters including name, X/Y coordinates, width, and height.

The sample program is shown below:

Interface Diagram

**Result: **As shown in the figure, you can obtain the number and name of gestures with ID1, as well as the coordinate position of the first detected ID1 gesture.

Interface Diagram

9.3 Hand Recognition Description

block description
Used to obtain one set of gesture recognition data under the Gesture Recognition function of HUSKYLENS 2.
Determines whether gestures exist in the current frame.
Obtains data for the gesture closest to the crosshair on the screen, including ID, name, center X/Y coordinates, width, and height.
Gets the total number of gestures detected on the screen.
When multiple gestures are detected, obtains the data of a specified gesture.
Determines whether a gesture with the specified ID exists in the image. (After HUSKYLENS 2 learns gestures, IDs are assigned sequentially.)
Obtains the total number of gestures with a specified ID in the current frame.
Obtains data for a gesture with a specified ID.
When multiple gestures share the same ID, obtains the data of a specified gesture.

10.Pose Recognition Blocks

10.1 Pose Recognition Outputs Data

HUSKYLENS 2 can recognize human bodies within its field of view and print related data through the serial port. The readable data include: the pose ID closest to the center of the HUSKYLENS 2 camera view, the total number of detected bodies, and the ID of the first detected pose.

The sample program is shown below.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete.se the touchscreen to enter the Pose Recognition function of HUSKYLENS 2. Aim the camera at human poses in the image to perform learning. For detailed steps, see HUSKYLENS 2 Wiki.

Interface Diagram

After the learning process is complete, open the serial port in Mind+ and observe the output results.
Result: The output includes the total number of detected bodies; pose IDs can be output as required. Learned poses are assigned IDs in learning order, while unlearned poses have ID 0.

Interface Diagram

10.2 Obtain Data of Specified Pose

After HUSKYLENS 2 recognizes human poses, it can obtain the data of a specified pose in the image. For example, determine whether a learned pose is present, get the pose name, and obtain the number of identical poses. When multiple identical poses appear, you can specify one pose to retrieve its parameters, including name, X/Y coordinates, width, and height.

The sample program is shown below:

Interface Diagram

Result: As shown in the figure, you can obtain the total number of poses, the count and name of ID1 poses, and the coordinates of the first detected ID1 pose.

Interface Diagram

10.3 Pose Recognition Blocks Description

block description
Used to obtain one set of pose recognition data under the Pose Recognition function of HUSKYLENS 2.
Determines whether human bodies exist in the current frame.
Obtains data for the pose closest to the crosshair, including pose ID, name, center X/Y coordinates, width, and height.
Gets the total number of detected bodies on the screen.
When multiple bodies appear, obtains the data of a specified body.
Determines whether a pose with a specified ID exists in the image. (After HUSKYLENS 2 learns poses, IDs are assigned sequentially.)
Obtains the number of poses with a specified ID in the current frame.
Obtains the data of a pose with a specified ID.
When multiple identical poses appear, obtains the data of one specified pose.

11.License Recognition Blocks

11.1 License Recognition Outputs Data

In the License Recognition function, when a license plate appears on the HUSKYLENS 2 screen, it can be detected and framed. You can obtain data of the plate closest to the crosshair and print it via the serial port. The readable data include: license ID, name, content (plate number), width, height, and the X/Y coordinates of the plate center.

The sample program is shown below.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete. Then use the touchscreen to enter the License Recognition function of HUSKYLENS 2.

Interface Diagram

Aim the HUSKYLENS 2 camera at the license plate, open the serial port in Mind+, and observe the output results.

**Result: ** For unlearned plates, the default output ID is 0.

Interface Diagram

You can point the camera at a learned license plate. For detailed instructions on how to learn license plates, see HUSKYLENS 2 WIKI

Result: For learned license plates, the output ID matches the ID displayed on the HUSKYLENS 2 screen.

Interface Diagram

11.2 Count Licenses and Output Specified License Data

When multiple licenses appear in the frame, use the following program to count all detected licenses and obtain data for a specific license ID.

Interface Diagram

Result: When multiple licenses appear in the frame, HUSKYLENS 2 can recognize all of them (both learned and unlearned). The serial port displays the total number of licenses detected and outputs data for the specified license (e.g., ID=1).

Interface Diagram

11.3 Count Specified Licenses and Output Data

When multiple licenses with the same ID appear (learned IDs are assigned sequentially and unlearned IDs default to 0), use the following program to count and obtain data for a specified license.

Interface Diagram

**Result: ** When multiple identical licenses appear, HUSKYLENS 2 can recognize all ID=1 licenses (if previously learned and assigned ID=1). The serial port displays the total number of ID1 licenses and outputs data for the first detected one.

Interface Diagram

11.4 License Recognition Block Description

block description
Used to obtain one set of license recognition data under the License Recognition function of HUSKYLENS 2.
Determines whether a license plate exists in the current frame.
Obtains data of the license closest to the crosshair, including ID, name, center X/Y coordinates, width, height, and decoded content.
Gets the total number of detected licenses (both learned and unlearned).
When multiple licenses are detected, obtains data for a specified license.
Determines whether a license with the specified ID exists in the frame. Unlearned licenses have ID=0, learned IDs follow learning order.
Obtains the number of licenses with a specified ID in the frame.
Obtains data for a specified license in the frame.
When multiple licenses share the same ID, obtains data for a specified license.

12.Optical Char Recognition Blocks

12.1 Recognize char and Output Data Near the Center

Under the Optical Char Recognition function, HUSKYLENS 2 can detect and highlight text areas in the field of view, and display the recognized text in the upper-left corner. You can use the following sample program to count the total number of recognizable text areas on the screen, get the text block nearest to the crosshair, and output related data through the serial port. The readable data includes: text block ID, name, content, center X/Y coordinates, text block width and height.

The sample program is as follows.

Interface Diagram

Click “Upload” in Mind+ and wait for uploading to finish. Touch the screen to enter HUSKYLENS 2 Optical Char Recognition.

Interface Diagram

Aim the HUSKYLENS 2 camera at any Optical Character. Open the serial port in Mind+ and observe the output.

** Result:** As shown below, for unlearned text blocks, the output ID is 0 by default.

Interface Diagram

Note: Under the Optical Char Recognition function, HUSKYLENS 2 detects all text areas and highlights them, but only recognizes the content of the text block closest to the crosshair and displays it in the upper left corner..

12. 2 Optical Char Recognition Block Description

block description
Used to acquire char recognition data once under HUSKYLENS 2 Optical Char Recognition.
Determine whether any text is detected in the current screen.
Get data of the text block nearest to the crosshair, including ID, name, center X/Y coordinates, width, and height.
Get the total number of detected text areas on screen.
When multiple text blocks are detected, get related data of a specified text block.
Determine whether a text block with a specified ID exists in the screen.
Determine whether a text block with a specified ID exists in the screen.
Get the number of text blocks with a specified ID.
When multiple identical text blocks appear, get related data of one specified text block.

13.Line Tracking

13.1 Line Tracking Output Data

Under the Line Tracking function, HUSKYLENS 2 can mark the route’s path in the image and obtain the current route’s length, angle, and X/Y components. When the route has branches, it can acquire the number of branches and the corresponding data of each branch in the counterclockwise direction.

The sample program is as follows.

Interface Diagram

Result: As shown in the figure, aim the HUSKYLENS camera on a map with a route. The serial monitor will output the current route’s length, angle, and other data. When multiple branches exist, the number of branches will be output.

Interface Diagram

block description
Used to obtain one set of Line Tracking data under the Line Tracking function of HUSKYLENS 2.
Determines whether lines exist in the current frame.
Obtains data for the line closest to the crosshair, including X component,Y component,angle,length.
Gets the total number of detected lines on the screen.
When multiple lines appear, obtaining the data of a specified body.

14.Face Emotion Recognition Blocks

14.1 Recognize All Facial Emotion

Under the Face Emotion Recognition function, HUSKYLENS 2 can recognize seven predefined expressions: Anger (ID 1), Disgust (ID 2), Fear (ID 3), Happy (ID 4), Neutral (ID 5), Sad (ID 6), and Surprise (ID 7). These expressions are pre-trained before shipment, and no manual learning is required. For detailed usage instructions, please refer toHUSKYLENS 2 WIKI.

The following sample program can count all recognized expressions in the camera view and output their related data sequentially.

The sample program is as follows.

Interface Diagram

Click “Upload” in Mind+ and wait for the upload to complete. Then switch to Face Emotion Recognition from the touchscreen.

Interface Diagram

When any of the seven expressions appear in the screen, HUSKYLENS 2 will highlight them and display the expression name and confidence score.

** Result: ** When a fearful expression appears, the serial port outputs the total number and corresponding expression name.

Interface Diagram

Result: When multiple facial expressions appear, the serial port outputs the total number and names of all recognized expressions.

Interface Diagram

14.2 Count Each Type of face emotion

Since output IDs are within 1–7, we can use the following sample program to count each expression type in the camera view.

Result: When multiple different expressions appear, the serial port outputs the type and number of each expression.

Interface Diagram

14.3 Face Emotion Recognition Block Description

block description
Used to obtain expression recognition data once under HUSKYLENS 2 Face Emotion Recognition.
Determine whether the current image contains seven specific expressions (anger (ID 1), disgust (ID 2), fear (ID 3), happiness (ID 4), neutral (ID 5), sadness (ID 6), and surprise (ID 7)).
Get data of the expression closest to the crosshair: ID, name, center X/Y coordinates, width, and height.
Get the total number of detected expressions.
Get the related data of a specified expression when multiple expressions are detected.
Determine whether an expression with a specified ID is present (anger (ID 1), disgust (ID 2), fear (ID 3), happiness (ID 4), neutral (ID 5), sadness (ID 6), and surprise (ID 7)).
Get the number of expressions with a specified ID.
Get the related data of an expression by its ID.
Get the related data of one specific expression when multiple identical expressions appear.

15.Tag Recognition Blocks

15.1 Recognize Tags and Output Related Data

Under the Tag Recognition function, HUSKYLENS 2 can recognize AprilTag labels in the image. The program can acquire data of the tag closest to the crosshair and output it through the serial. The readable data includes: tag ID, tag content, tag width, tag height, and X/Y coordinates of the tag center.

The sample program is as follows.

Interface Diagram

Click Upload in Mind+ and wait for completion. Use touchscreen to enter Tag Recognition.

Interface Diagram

When a tag is detected, HUSKYLENS 2 will highlight it with a bounding box and show the decoded content. Open the serial in Mind+ and observe the related data.

**Result: **For unlearned tags, the ID defaults to 0 and matches the screen display.

Interface Diagram

**Result: **For learned tags, the ID and content match the screen display.

Interface Diagram

Note: If a complete tag appears but is not recognized, check whether the tag size matches the Dict parameter.

For detailed usage instructions, see:HUSKYLENS 2 WIKI.

15.2 Count Total Tags and Output Data of a Specified Tag

When multiple tags appear, the following program counts them and retrieves data for a specified ID.

The sample program is as follows.

Interface Diagram

Result When multiple tags appear on the screen, HUSKYLENS 2 can recognize all tags (both unlearned and learned). The total number of tags on the screen can be observed and counted through the serial port. At the same time, the serial port prints the relevant data of the tag with the specified ID 1.

Interface Diagram

15.3 Count Specific Tags ID and Output Data

When multiple tags have the same ID, count them and get data from one of them.

The sample program is as follows.

Interface Diagram

Result: When multiple identical tags appear on the screen, HUSKYLENS 2 can identify all tags with ID 1 (assuming a tag has been learned and assigned ID 1, and unlearned tags are assigned ID 0). The total number of ID1 tags on the screen can be observed through the serial port. At the same time, the serial port outputs the relevant data of the first tag with ID 1.

Interface Diagram

15.4 Tag Recognition Block Description

block description
Acquire tag recognition data once.
Determine if any tag is detected.
Get data of tag closest to crosshair: ID, center X/Y coordinates, width, height, decoded content.
Get total number of detected tags,including both unlearned and learned labels.
Get data of a specified tag.
Determine whether a tag with the specified ID exists.The IDs of unlearned tags are all set to 0, and the IDs of learned tags are sorted in the order in which they were learned.
Get the number of tags with a specified ID.
Get data of a specified ID tag.
Get data of a specified one when multiple tags share the same ID.

16.QR Code Recognition Blocks

16.1 Recognize QR Codes and Output Related Data

Under QR Code Recognition, HUSKYLENS 2 can recognize QR codes. The program retrieves data of the QR code closest to the crosshair and prints via serial ID, name, decoded content, width, height, center X/Y coordinates.

The sample program is as follows.

Interface Diagram

Click Upload in Mind+ and enter QR Code Recognition by touchscreen.

Interface Diagram

After the QR code is recognized, the HukyLens 2 screen will frame the QR code and display the parsed QR code content in the upper left corner of the frame. Open the Mind+ serial port and observe the serial port output the relevant data of the QR code closest to the crosshairs.

Result: ID=0 for unlearned; decoded content matches display.

Interface Diagram

Result:Learned QR code ID matches display.

Interface Diagram

16.2 Output Data of a Specified QR Code

When multiple QR codes appear, count them and output data for a specified ID.

Interface Diagram

Result: when multiple QR codes appear on the screen, HUSKYLENS 2 can recognize all QR codes (both unlearned and learned), and the total number of QR codes on the current screen can be observed and counted through the serial port. At the same time, the serial port prints the relevant data of the QR code with the specified ID 1.

Interface Diagram

16.3 Count of a Specific ID and Output Related Data

When multiple QR codes with the same ID appear on the screen (the IDs of learned QR Codes are assigned in the order of learning, and the IDs of unlearned tags are all 0), you can use the following sample program to count the number of QR codes with the same ID on the screen and obtain the relevant data of a specified ID QR code.

Interface Diagram

Result: When multiple identical QR codes appear on the screen, HUSKYLENS 2 can recognize all QR codes with ID 1 (assuming a QR code has been learned and assigned ID 1, and unlearned QR codes are assigned ID 0). The total number of QR codes with ID 1 on the current screen can be observed and counted through the serial port. The serial port also outputs the data related to the first QR code with ID 1.

Interface Diagram

16.4 QR Code Recognition Block Description

block description
Acquire QR code recognition data once.
Determine whether a QR code 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 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.

17.Barcode Recognition Blocks

17.1 Recognize Barcodes and Output Data

Under the Barcode Recognition function, HUSKYLENS 2 can recognize barcodes in the image. The program can retrieve data of the barcode closest to the crosshair and output via serial. The readable data includes: barcode ID, barcode content, barcode width, barcode height, and X/Y coordinates of the barcode center.

The sample program is as follows.

Interface Diagram

Click Upload in Mind+ and wait for completion. Then enter Barcode Recognition via the touchscreen.

Interface Diagram

When a barcode is detected, HUSKYLENS 2 highlights it with a bounding box and displays the decoded content. Open the serial in Mind+ to observe related data of the barcode closest to the crosshair.

Result: Unlearned barcodes default to ID = 0, and the content matches the screen display.

Interface Diagram

Result: For learned barcodes, the ID and content match the screen display.

Interface Diagram

17.2 Count Total Barcodes and Output Data of a Specified Barcode

When multiple barcodes appear, the program can count the total number and retrieve data of a barcode with a specified ID (ID=0 for unlearned; learned IDs assigned in learning order).

Interface Diagram

Result: All detected barcodes appear in the serial output (both learned and unlearned), including total count and data for barcode ID = 1.

Interface Diagram

17.3 Barcode Recognition Block Description

block description
Retrieve barcode recognition data once.
Determine whether any barcode is detected.
Get data of the barcode closest to the crosshair: ID, name, center X/Y coordinates, width, height, decoded content.
Get the total number of detected barcodes, including learned and unlearned.
Get data of a specified barcode when multiple are detected.
Determine whether a barcode with a specified ID exists. (ID=0 for unlearned)
Get the number of barcodes with the specified ID.
Get related data of barcodes with the specified ID.
When multiple barcodes share the same ID, get related data for one of them.

18.Instance Segmentation Code Example

18.1Instance Segmentation and Output Related Data

Under the Instance Segmentation function, HUSKYLENS can recognize object classes in the image and outline each object. The program can print the total instance count, the instance closest to the center, and related data of a specified instance ID, including name, ID, center X/Y coordinates, width, and height.

The sample program is as follows.

Interface Diagram

Result: After Upload completes, HUSKYLENS 2 automatically switches to Instance Segmentation. Aim at a recognizable object (must belong to one of the 80 classes) and observe the terminal for detected instance count, specified instance ID, center coordinates, etc.

Interface Diagram

18.2 Obtain Data of a Specified Instance

Under the Instance Segmentation function, after learning, HUSKYLENS 2 can retrieve related data of a specified instance, such as determining whether a learned instance exists in the image, obtaining its name, and counting instances of the same class. When multiple instances of the same class appear, related parameters such as name, X/Y coordinates, width, and height can be retrieved for one specified instance.

The sample program is as follows.

Interface Diagram

Result: After Upload completes, HUSKYLENS 2 automatically switches to Instance Segmentation. When multiple instances of the same class appear, the system can count them and output related data such as ID and center coordinates of the specified instance.

Interface Diagram

18.3 Instance Segmentation Blocks Description

block description
Acquire tag instance segmentation data once.
Determine whether any barcode is detected.
Determine if an instance is present in the current frame.
Obtain relevant data of the instance nearest to the screen crosshair, including the instancee's ID, name, center X coordinate, center Y coordinate, width, and height.
Get the total number of instances detected on the screen, including both unregistered and registered instances.
Obtain the relevant data of a specified instance when multiple instances appear.
Determine if an instance with the specified ID exists in the frame. Unlearned IDs are uniformly set to 0, and learned IDs are sorted in the order they were learned.
Get the number of instances with a specified ID.
Obtain the number of instances with the specified ID in the current frame.
When multiple instances are detected, retrieve the relevant data of a specified instance.