User`s guide

Creating Image Acquisition Objects
5-9
objects by default, but you can change this selection. See “Specifying the Selected Video
Source Object” on page 5-13 for more information.
The following figure illustrates how a video input object acts as a container for one or
more video source objects.
Relationship of Video Input Objects and Video Source Objects
For example, a Matrox frame grabber device can support eight physical connections,
which Matrox calls channels. These channels can be configured in various ways,
depending upon the video format. If you specify a monochrome video format, such as
RS170, the toolbox creates eight video source objects, one object for each of the eight
channels on the device. If you specify a color video format, such as NTSC RGB, the
Matrox device uses three physical channels to represent one RGB connection, where each
physical connection provides the red data, green data, and blue data separately. With
this format, the toolbox only creates two video source objects for the same device.
Creating a Video Input Object
To create a video input object, call the videoinput function specifying the adaptor
name, device ID, and video format. You retrieved this information using the imaqhwinfo
function (described in “Getting Hardware Information” on page 5-2). The only required
argument is the adaptor name. The toolbox can use default values for the device ID and
video format.
This example creates a video input object to represent the connection to a Matrox image
acquisition device. The imaqhwinfo function includes the default videoinput syntax in
the VideoInputConstructor field of the device information structure.
vid = videoinput('matrox');