VEX IQ Python API
Public Member Functions | Public Attributes | List of all members
vision.Vision Class Reference
Inheritance diagram for vision.Vision:
vex.Device

Public Member Functions

def __init__ (self, index, brightness=None, signatures=None)
 Creates a new vision object on the port specified. More...
 
def take_snapshot (self, id, count=None)
 Takes a data sample from the vision sensor. More...
 

Public Attributes

 object_count
 Number of objects found in the data sample. More...
 
 objects
 List of the largest objects found in the data sample. More...
 
 largest_object
 The largest object found in the data sample. More...
 

Constructor & Destructor Documentation

◆ __init__()

def vision.Vision.__init__ (   self,
  index,
  brightness = None,
  signatures = None 
)

Creates a new vision object on the port specified.

The vision sensor has a resolution of 316x212 pixels

Parameters
indexThe port index for this vision. The index is zero based.
brightnessThe vision sensor brightness seting. Values are 0 to 255
signaturesList of signature objects used to setup the detection signatures for this sensor.

Member Function Documentation

◆ take_snapshot()

def vision.Vision.take_snapshot (   self,
  id,
  count = None 
)

Takes a data sample from the vision sensor.

Parameters
idThe signature id or color code of the object to look for.
countthe amount of objects to look for. The largest of the object will be returned. Optional.
Returns
The number of objects found from the ID passed in the parameter.

Member Data Documentation

◆ object_count

vision.Vision.object_count

Number of objects found in the data sample.

◆ objects

vision.Vision.objects

List of the largest objects found in the data sample.

@type vision.VisionObject[]

◆ largest_object

vision.Vision.largest_object

The largest object found in the data sample.

@type vision.VisionObject