Adjusting the Vision Sensor in VEXcode Pro V5

The VEX Visual Studio Code Extension has replaced VEXcode Pro V5, which is now end-of-life.

VEXcode Blocks and VEXcode Text remain actively developed and supported for all VEX platforms.

A Vision Sensor can be used to see objects and allow your robot to interact with the world around it. Occasionally, the robot may have difficulty detecting known objects. Known objects are objects that have been previously configured to be recognized by the Vision Sensor. Often times an object is configured to be recognized by the Vision Sensor in one environment, for example, in a classroom. When the Vision Sensor is then taken into a different environment such as a competition setting, the object may not be recognized by the Vision Sensor. This is often due to a change in lighting after the Vision Sensor has already been configured. To solve this problem, you may have to tune your Vision Sensor. 

In this article, we will be using the Detecting Objects (Vision) example project.


VEXcode Pro V5 interface with Robot Configuration button highlighted on the Toolbar.

In VEXcode Pro V5, select the Robot Configuration button to open the Robot Configuration window. A project must be open in order to use the Robot Configuration window.

The Vision Sensor Settings panel in VEXcode Pro V5 with the sensor labeled as Vision5. A blue button labeled Configure is highlighted.

Choose the Vision Sensor from the Devices list and select “Configure” to launch the Vision Utility.

In this project, the Vision Sensor has been configured to detect a blue, red, or green object. Place a known object in front of the Vision Sensor.     

Vision Sensor utility showing a red object with incomplete detection overlay due to lighting conditions.

Here, the Vision Sensor should detect that this is a red object. However, since the lighting conditions have changed, the Vision Sensor is having trouble detecting the red object.


Adjusting the Signature Slider

Vision Sensor settings panel with signature slider for the red object highlighted.

Select the signature slider of the red object.

Vision utility showing red object detection alongside signature slider being adjusted to improve recognition.

Move the slider to detect more of the red object. The slider determines the width of the color to be detected. Increasing the width means including lighter and darker shades of a color.

Note: It is important to keep in mind that changing the slider too much could hinder the accuracy of the reading.


Adjusting the Brightness

Another way to tune the Vision Sensor is to change the brightness. Changing the brightness increases or decreases the Vision Sensor’s sensitivity to light. This allows the Vision Sensor to be used in different environments. 

Vision Sensor settings panel with brightness slider highlighted for adjusting light sensitivity.

Select the brightness slider.

Note: Adjusting the brightness affects all colors.    

Vision utility showing red object detection with brightness slider adjusted to improve visibility.

Move the slider to adjust the Vision Sensor’s sensitivity to light for it to be able to detect the color signatures more accurately.

Note: It is important to keep in mind that changing the slider too much could hinder the accuracy of the reading.


Resetting the Signature

Depending on the environment and the color of the signature set, adjusting the brightness or the signature slider may not work. Another option is to clear the color signature and reset the signature.

Vision Sensor settings with Clear button highlighted to remove an existing color signature.

Clear the set signature.

Vision utility showing red object with Freeze button highlighted to capture a still image.

Place the object in front of the Vision Sensor and select “Freeze” to still the image.

Vision utility showing a selected area on a red object used to define a new color signature.

Select a colored area on the object that will be used to configure the color. The “Set” icons will turn green when a new signature is being configured.

Vision Sensor settings with Set button highlighted to save a newly selected color signature.

Once the colored area has been selected, configure the color by selecting the “Set” button.

Vision utility showing red object detection after resetting the signature, with detection overlay updated and more accurate.

The signature has been reset and the “Set” icons have returned back to blue.

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

Last Updated: