HUSKYLENS 2 Color Recognition Function Description

This guide explores the HUSKYLENS 2 color recognition function, detailing how to use, learn, and recognize colors, adjust parameters like color tolerance and area thresholds, export and import models for enhanced detection and tracking, and set custom names for recognized colors.

1.Introduction to Color Recognition

This function enables detection, learning, recognition, and tracking of specified colors.

Interface Diagram

2.Color Recognition Usage Guide

In this section, we will learn how to use HUSKYLENS 2 to detect specified colors in the image,learn and recognize those colors.

2.1 Enable Color Recognition Mode

Power on HUSKYLENS 2, and after successful startup, navigate to the "Color Recognition" function.

Interface Diagram

2.2 Observe Color Detection Effect

Align the "plus" sign in the center of HUSKYLENS 2 with the specified color to detect. The color block will be framed by a white box. If there are very similar color blocks in the image, they will also be framed.
Note: Color detection only detects (frames) the color that the "plus" sign points to or is aligned with, not frames all color blocks in the image.

Interface Diagram

2.3 Learning Colors and Observing Results

Align HUSKYLENS 2 with the target color to be learned. Adjust the angle of HUSKYLENS 2's view so that the "plus" sign in the center of the screen touches the target color. Then press the "A" button in the top-right corner of HUSKYLENS 2 to learn this color.

Interface Diagram

After learning a color, if the camera detects the learned color, the screen will frame the color block with a colored frame and display the color name and ID number above it. For example, "Color: ID1". The color name defaults to "Color"; to set a custom color name, see "Parameter Settings". To learn more colors, repeat the process accordingly.

Interface Diagram

3.Color Recognition Parameter Settings

HUSKYLENS 2’s factory default parameters meet the needs of basic functionality. For more refined features, individual parameters can be adjusted manually. The following parameters are all based on the "Color Recognition" function—therefore, first ensure that you have entered the "Color Recognition" function, as shown in the figure.To modify a parameter, slide left or right on the parameter text below the screen to select it.

Interface Diagram

3.1 Forget ID

To forget all previously learned colors: Step 1, tap "Forget ID" on the screen; Step 2, after the pop-up window "Forget All IDs and Names" appears, tap "Yes".

Interface Diagram

Now, align the "crosshair" in the center of the HUSKYLENS 2 screen with the color you want to "forget". A white frame will appear on the screen, and if the system does not recognize the color, it means the "forget" process is completed.

Interface Diagram

3.2 Color Block Area Threshold

In color recognition tasks, the color block area threshold refers to the "minimum area that we set to be recognized as a color block". Only color blocks with an area greater than the threshold will be identified and framed; otherwise, they will be ignored.

Setting Steps: Tap "Color Block Area Threshold", and a parameter adjustment slider will appear above it. Swiping left reduces the value, and swiping right increases it.

Effect as shown in the figure: When the threshold is increased, originally identifiable color blocks will no longer be recognized because their area is smaller than the threshold.

Interface Diagram

3.3 Color Tolerance

In the Color Recognition feature of HUSKYLENS 2, the target color is determined by the color area selected by the crosshair cursor. HUSKYLENS 2 will automatically frame all color blocks similar to the target color in the current image.

You can adjust the color tolerance to set the strictness of color recognition. A smaller color tolerance value results in more lenient color recognition, which will frame not only the target color but also some colors close to it. A larger color tolerance value yields stricter recognition and more accurate results.

Note: This explanation of color tolerance applies only to HUSKYLENS 2

Setting Steps: Click "Detection Threshold", and a parameter adjustment slider will appear above it. Sliding left reduces the value, and sliding right increases it. The effect is shown in the figure.

Interface Diagram

3.4 Set Name

This parameter enables you to set names for the colors recognized, which can be in both Chinese and English.

Setting steps: Tap "Set Name", slide up/down the number display in the top-left corner to select which ID to name; Tap the on-screen keyboard to set the name as shown in the left image; After completion, tap the checkmark button in the bottom-right corner to save. A green checkmark will appear in the top-right corner once saved successfully.

Interface Diagram

3.5 Display Name

This parameter controls whether to display the name when a learned color is recognized, with the default being "On".

Setting steps: Click "Display Name". If the switch above the button is blue, it is the "On" state, and the name will be displayed when a learned color is recognized (as shown in the left image). Click the switch to make it white, which is the "Off" state, and the name will not be displayed when a learned color is recognized (as shown in the right image).

Interface Diagram

3.6 Restore Defaults

This parameter restores all settings to their default values and clears the learned IDs and names, but does not delete the exported models (see the following section for details on exporting models).

Setting steps: Click "Restore Defaults", and after the "Restore Default Configuration" pop-up appears, click "Yes".

Interface Diagram

3.7 Export Model

This parameter allows you to save and export the currently configured parameters, learned IDs, and set names to the internal memory of HUSKYLENS 2. It is applicable for scenarios such as migrating parameters to another HUSKYLENS 2, and this operation does not require an SD card.

Export Steps: Click "Export Model". When the "Save Configuration to" pop-up window (as shown in the left figure) appears, slide up/down the number to select the model number for saving (up to 5 models can be saved). Then click the "Confirm" button at the bottom-left corner of the pop-up window to save. After confirmation, the export will start automatically, as shown in the figure.

Interface Diagram

View Exported Model

After the "Exporting" pop-up disappears, you can view the exported model file on your computer.

First, connect the HUSKYLENS 2 to your computer's USB port.

Interface Diagram

Next, access the memory of HUSKYLENS 2 through your computer via the path shown in the following figure. You can view two model-related files with extensions .json and .bin. The number before the extension is the "model number" selected when saving the configuration. Both files can be copied and pasted elsewhere.

Interface Diagram

3.8 Import Model

This parameter allows you to import models exported by HUSKYLENS 2 (hereinafter referred to as "Husky A") to another HUSKYLENS 2 (hereinafter referred to as "Husky B"), so that Husky B can recognize the colors that Husky A knows without re-learning them.

Import Steps:
Step 1: Connect Husky A to the computer and copy the two exported model files to the computer desktop.
Step 2: Connect Husky B to the computer and paste the two files from the previous step into the specified folder on Husky B, as shown in the path diagram below. (If the "color-recognition" folder cannot be found, please perform Step 3 first. After importing the model, this folder will be automatically created, and then return to Step 2.)

Interface Diagram

Step 3: First, confirm you have entered the "Color Recognition" function. Then click "Import Model". After the "Load Configuration" pop-up appears, scroll the number up and down to select which model to load. This should match the model number saved in the previous step. For example, if the model files pasted into Husky B are config0.json and repo0.bin, select the number 0. Finally, click "Yes" to import.

Step 4: Wait until the "Loading" pop-up disappears, indicating the import is complete.

Interface Diagram

Then you can perform a color recognition test. The left image below shows the color recognition status of Husky B before model import, and the right image shows the status after model import.

Interface Diagram

Was this article helpful?

TOP