Understanding the Data in the AI Vision Utility in VEXcode EXP

The AI Vision Utility is what allows you to connect and configure your AI Vision Sensor. To read about how to do so, you can read these articles here:

Understanding how the AI Vision Sensor detects and measures objects can help you better use these measurements in your coding projects. With this knowledge, you can improve your coding skills and create more precise solutions for tasks like object recognition and spatial analysis.

Understanding Hue and Saturation

color adjustments.png

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.

vex-rainbow-circle-graphic_2.jpg

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.

saturation@2x.png

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.

Understanding Pixels and Resolution

grid-doodle-house.png

Imagine you're drawing a picture on a piece of grid paper. Each tiny square on the paper is like a pixel. When you color in these squares, you're making your picture.

Low Resolution High Resolution

Now, let's talk about resolution. Resolution is the number of pixels in an image. If you have lots of tiny squares (pixels) in your grid paper, your picture will look sharp and detailed. But if you only have a few pixels, your picture might look blurry and not very clear.

The AI Vision Sensor has a resolution of 320 pixels horizontally by 240 pixels vertically. This means that the precise center of detection aligns with coordinates 160 on the X-axis and 120 on the Y-axis.

How Does the AI Vision Sensor Measure Objects

Data Reported by the Sensor

The AI Vision Sensor collects data on configured colors, AprilTags, and AI Classifications. Some of this data is shown in the AI Vision Utility and can help when planning and creating a VEXcode project. 

The image shows a blue Buckyball with a white square outline tracking it. The top left corner has a label indicating it is a blue object, with coordinates X:176, Y:117, and dimensions W:80, H:78. Red arrows highlight the width and height of the object.

Width and Height

This is the width or height of the detected object in pixels.

The width and height measurements help identify different objects. For example, a Buckyball will have a larger height than a Ring.

 

A blue Buckyball being tracked by a computer vision system. The object is outlined with a white square, and inside the outline is a smaller red square surrounding a centered white cross. In the top-left corner of the image, a label indicates the object is blue, with coordinates X:176, Y:117, and dimensions W:80, H:78.

CenterX and CenterY

This is the center coordinates of the detected object in pixels.

CenterX and CenterY coordinates help with navigation and positioning. The AI Vision Sensor has a resolution of 320 x 240 pixels.

Angle

Angle is a property only available for Color Codes and AprilTags. This represents if the detected Color Code or AprilTag is orientated differently.

 

A blue Buckyball being tracked by a vision system. A white outline surrounds the object, with a centered white cross inside the outline. The top-left label indicates the object's color as blue, along with coordinates X:176, Y:117, and dimensions W:80, H:78. A small red square highlights the object's top-left corner.

OriginX and OriginY

OriginX and OriginY is the coordinate at the top-left corner of the detected object in pixels.

OriginX and OriginY coordinates help with navigation and positioning. By combining this coordinate with the object's Width and Height, you can determine the size of the object's bounding box. This can help with tracking moving objects or navigating between objects.

 

Three square cards with AprilTags being tracked by a vision system. Each card is labeled with an ID number and associated tracking data. The card on the left is labeled ID:0, showing coordinates A:350°, X:110, Y:96, W:41, H:41. The middle card, labeled ID:3, has coordinates A:1°, X:187, Y:180, W:57, H:57. The card on the right is labeled ID:9, with coordinates A:3°, X:237, Y:89, W:38, H:38. Each card has a white outline, and the system is tracking their positions and orientations.

Tag ID

The tag ID is only available for AprilTags. This is the ID number for the specified AprilTag.

Identifying specific AprilTags allows for selective navigation. You can program your robot to move towards certain tags while ignoring others, effectively using them as signposts for automated navigation.

The image shows four objects being tracked by a vision system: two balls and two rings. The red ball is labeled with coordinates X:122, Y:84, W:67, H:66, and a score of 99%. The blue ball has X:228, Y:86, W:70, H:68, with a score of 99%. The green ring has coordinates X:109, Y:186, W:98, H:92, and a score of 99%. The red ring is labeled X:259, Y:187, W:89, H:91, with a score of 99%. Each object is outlined in white, indicating tracking accuracy.

Score

The score property is used when detecting AI Classifications with the AI Vision Sensor.

The confidence score indicates how certain the AI Vision Sensor is about its detection. In this image, it's 99% confident in identifying these four objects' AI Classifications. You can use this score to ensure your robot only focuses on highly confident detections.

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

Last Updated: