Configuring Color Signatures with the AI Vision Sensor in VEXcode EXP

A Color Signature is one of the two types of Visual Signatures utilized by the AI Vision Sensor for color identification. To enable the AI Vision Sensor to recognize Color Signatures, they need to be configured initially. Follow the steps outlined in this article to properly configure Color Signatures.

Ensure your AI Vision Sensor is connected to VEXcode EXP. For information on how to setup and connect your AI Vision Sensor, read Connect the AI Vision Sensor to App-based VEXcode EXP or Web-based VEXcode EXP.

Configure a Color Signature

AI Vision Utility with a red Buckyball placed in the center of the live video feed.

1. Put what solid-colored object you want the AI Vision Sensor to be able to recognize in front of it.

The cursor is shown selecting a rectangle over the red Buckyball in the video feed.

2. Position your mouse cursor over the solid-colored object, then select and drag across the desired color to configure it.

Note: Make sure to stay within the confines of the color you want to select. Otherwise, you may accidentally grab colors from the background that can throw off the AI Vision Sensor’s detection.

After selecting the rectangle over the Buckyball, the cursor selects the Set Color button in the Color Signature options to the right.

3. The Set Color button will become available. Select it to save the color.

Once a color is set, the AI Vision Sensor will save it as a Color Signature.

The Color Signature's name is highlighted to indicate that it can be changed by selecting it. By default, the name reads COLOR1.

4. Rename the color signature by selecting into the Name textbox and typing.

The previous Color Signature has been renamed to Red, and now the Add Color button is highlighted below.

5. Select Add Color to configure any further Color Signatures for other objects.

The AI Vision Sensor can track up to 7 Color Signatures at a time.

AI Vision Utility with two set Color Signatures, one reads Red and one reads Blue. The video feed now shows a blue Buckyball placed near the red one from before. The Close button is highlighted in the bottom right corner.

6. Once all desired colors have been set, select Close.

VEXcode EXP Devices menu is opened to the AI Vision Sensor Settings menu. The Done button in the bottom right corner is highlighted.

7. Once the AI Vision Sensor window is gone, select Done to exit the Devices menu and save your configuration changes.


Tune a Color Signature

Color Signatures can have their Hue Range and Saturation Range tweaked so the sensor can detect the color easier.

AI Vision Utility with a color signature's options shown. The color signature is named Blue and has a Hue Range value of 32 and a Saturation Range value of 0.57. There are Hue Range and Saturation Range slider controls below each setting.

When configuring a color signature, options appear for both Hue and Saturation Ranges. These allow you to tune the color signature to be more resilient. A color signature is considered resilient when the object can be moved around and still be tracked by the AI Vision Utility.

Color wheel demonstrating how the 360 degree circle correlates to a hue value. The color red is at a degree of 0, the color green is at a degree of 120, and the color blue is at a degree of 240.

The first slider is the Hue Range. Hue is the color perceived, as defined by its position on the color wheel. This color wheel has a range of 0 to 359.9 degrees and each color on the wheel has a defined degree value. 

The Hue Range allows you to choose the degrees above and below the configured color that will report as that color. For example, a dark blue may have the hue value of 240 degrees. With a Hue Range of 20 degrees, anything from 220 degrees to 260 degrees will report as that dark blue configured color.

Video of the Hue Range slider being gradually increased from 0 until a red Buckyball in the video feed is fully highlighted by the Color Signature's rectangle.

To tune your color configuration, slowly move the Hue Range slider until the target box is stable around the object. Do not move it any further than it needs to.

Graph of a saturation value increasing from 0% to 100%. The 0% saturation value is the color gray, and the 100% saturation value is colored bright red.

The second slider is the Saturation Range. Saturation is the intensity or purity of the color. The brighter the color, the more saturated it is. Saturation is a relative scale measured with percentages from 0%, being a muted grey tone, and 100% being a intense version of that hue. 

The Saturation Range allows you to choose the percent of saturation above and below the configured color that will report as that color. For example, a red ball in dimmer lighting may appear as 50% saturation. With a Saturation Range of .25 (the decimal equivalent of 25%), anything from 25% to 75% saturation will report as that red configured color.

Video of the Saturation Range slider being gradually increased from 0 until a red Buckyball in the video feed is fully highlighted by the Color Signature's rectangle.

Move the slider for the Saturation Range until the object you want to track is fully surrounded by the target box.

Now you can test the resiliency of your Color Signature. Put the object in different lighting conditions or move it around to see if the AI Vision Sensor can continue to track it in different settings and conditions.

Once two or more Color Signatures have been set, you can begin to configure Color Codes.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: