Main Content

Train V5 Vision Sensor for Color Signature

The V5 Vision Sensor connected to V5 Robot Brain needs to be trained for color signatures that are saved on the sensor. The VEX Vision Utility, which helps you to train the sensor, is available as part of the installation of Simulink® Coder™ Support Package for VEX® EDR V5 Robot Brain.

Calibrate and Save Color Signature on V5 Vision Sensor

  1. Connect the V5 Vision Sensor to the host computer using micro-USB cable.

    Note

    • Do not hold the button on the V5 Vision Sensor while plugging in the USB cable (it triggers an unwanted Update mode).

    • The V5 Robot Brain does not need to be connected to the host computer or switched-on for training the V5 Vision Sensor.

  2. In the Simulink model, open the Vision Sensor block from the Simulink model and click Launch V5 Vision Utility.

    The VEX Vision Utility opens in a separate window.

  3. Position the colored object in the field of view of the V5 Vision Sensor so that the object takes up the majority of the frame in the VEX Vision Utility.

  4. Click and hold on one corner of the colored object, drag the cursor to the opposite corner of the object, and then release. This creates a red rectangle over the colored object.

  5. Click Set corresponding to a particular signature (for example, SIG_1) to store the selection as a color signature.

  6. Click on the arrows to the right of the selected Set button, and then drag the slider that appears, to the left or right. You can do this until most area of the colored object is highlighted while the background and other objects are not highlighted.

  7. Move the colored object within the field of view of the Vision Sensor to ensure that it is being tracked.

  8. Save all the changes and close the VEX Vision Utility. The signatures are now saved to the V5 Vision Sensor.

    Note

    The V5 Vision Sensor is sensitive to different levels of illumination. You need to train the sensor again if the illumination levels change in the actual environment.

Verify Color Signature in the Deployed Model

In the Simulink model, you design the logic using the Vision Sensor block. In the block mask, ensure that you select the same color signature that is saved in the V5 Vision Sensor (using the VEX Vision Utility).

To verify the color signature:

  1. Connect the V5 Robot Brain to the host computer.

  2. Connect the V5 Vision Sensor to the Smart port on the V5 Robot brain (the same Smart port that is selected in the block mask of the Vison Sensor block in the Simulink model).

  3. Deploy the Simulink model to the V5 Robot brain and run the model.

  4. Place a colored object (which uses the same color that you used for training the sensor and saving the signature) in the field of view of the V5 Vision Sensor.

    Based on the logic that you defined in the Simulink model, the robot moves according to the placement of the colored object.