Vision Sensor#
Introduction#
The Vision Sensor for VEX V5 detects and tracks colors and color codes. This allows the Vision Sensor to analyze its surroundings, follow objects, and react based on detected visual data.
Below is a list of all available blocks:
Actions – Capture data from the Vision Sensor for a selected signature.
take Vision Sensor snapshot – Captures data for a specific Color Signature or Color Code.
Settings – Choose which object to interact with.
set Vision Sensor object item – Selects a specific object from the detected object list.
Values – Access and use the captured data.
Vision Sensor object exists? – Returns whether an object is detected.
Vision Sensor object count – Returns the number of detected objects.
Vision Sensor object property – Returns details such as:
Actions#
take Vision Sensor snapshot#
The take Vision Sensor snapshot block filters data from the Vision Sensor frame. The Vision Sensor can detect signatures that include configured colors and color codes.
Colors and color codes must be configured first in the Vision Utility before they can be used with this block.
The dataset stores objects ordered from largest to smallest by width, starting at item 1. Each object’s properties can be accessed using Vision object property block. An empty dataset is returned if no matching objects are detected.
[Vision1 v]una instantánea de [SELECT_A_SIG v]
Parameter |
Description |
|---|---|
device |
Which Vision Sensor to use, configured in the Devices window. |
signature |
The color signature or color code to analyze in the snapshot. |
Settings#
set Vision Sensor object item#
The set Vision Sensor object item block sets which item in the dataset to use.
Establecer el elemento de objeto [Vision1 v] en (1)
Parameter |
Description |
|---|---|
device |
Which Vision Sensor to use, configured in the Devices window. |
item |
The number of the item in the dataset to use. |
Values#
Vision Sensor object exists?#
The Vision Sensor object exists? block returns a Boolean indicating whether any object is detected in the dataset.
True – The dataset includes a detected object.
False – The dataset does not include any detected objects.
<¿Existe [Vision1 v] objeto?>
Parameter |
Description |
|---|---|
device |
Which Vision Sensor to use, configured in the Devices window. |
Vision Sensor object count#
The Vision Sensor object count block returns the number of detected objects in the dataset as an integer.
([Vision1 v] recuento de objetos)
Parameter |
Description |
|---|---|
device |
Which Vision Sensor to use, configured in the Devices window. |
Vision Sensor object property#
There are five properties that are included with each object (shown below) stored after the take Vision Sensor snapshot block is used.
([Vision1 v] objeto [amplitud v])
Some property values are based off of the detected object’s position in the Vision Sensor’s view at the time that the take Vision Sensor snapshot block was used. The Vision Sensor has a resolution of 316 by 212 pixels.
Parameter |
Description |
|---|---|
device |
Which Vision Sensor to use, configured in the Devices window. |
property |
Which property of the detected object to use: |
width#
width returns the width of the detected object in pixels as an integer from 1 to 316.
([Vision1 v] objeto [amplitud v])
height#
height returns the height of the detected object in pixels as an integer from 1 to 212.
([Vision1 v] objeto [altura v])
centerX#
centerX returns the x-coordinate of the center of the detected object in pixels as an integer from 0 to 316.
([Vision1 v] objeto [centroX v])
centerY#
centerY returns the y-coordinate of the center of the detected object in pixels as an integer from 0 to 212.
([Vision1 v] objeto [centroY v])
angle#
angle returns the orientation of the detected Color Code as an integer in degrees from 0 to 180.
([Vision1 v] objeto [ángulo v])