User manual

Table Of Contents
Small Vision System User Manual 60
5.6 Video Acquisition
The video acquisition classes are subclasses of svsAcquireImages. The general class is
svsVideoImages, which is referenced by user programs. This class adds parameters and functions that
are particular to controlling a video device, e.g., frame size, color mode, exposure, and so on.
Particular types of framegrabbers and stereo heads have their own subclasses of svsVideoImages. In
general, the user programs won’t be aware of these subclasses, instead treating it as a general
svsVideoImage object.
A particular framegrabber interface class is accessed by copying a DLL file to
svsgrab.dll. For
example, for the MEGA-D stereo head and IEEE 1394 interface, copy svspix.dll to svsgrab.dll (see Section
2.1). Every such interface file defines a subclass of
svsVideoImages that connects to a particular type
of framegrabber and its associated stereo head.
To access the
svsVideoImages object for the interface file, the special function
svsGetVideoObject() will return an appropriate object.
5.6.1 Video Object
svsVideoImages *svsGetVideoObject()
Returns a video acquisition object suitable for streaming video from a stereo device. The particular
video object that is accessed depends on the video interface file that has been loaded; see Section 2.1, This
function creates a new video object on each call, so several devices can be accessed simultaneously, if the
hardware supports it.
5.6.2 Device Enumeration
int Enumerate()
char **DeviceIDs()
Several MEGA-D and Dual DCAM stereo devices can be multiplexed on the same computer. Any
such device connected to an IEEE 1394 card is available to SVS. The available devices are enumerated by
the
Enumerate() function, which returns the number of devices found, and sets up an array of strings
that have the identifiers of the devices. The ID array is returned by the
DeviceIDs() function. The user
application should not destroy or write into the array, since it is managed by the video object. The strings
are unique to the device, even when plugged into different machines.
The
Enumerate() function rescans the bus each time it is called, so whenever devices are plugged
or unplugged, it can be called to determine which devices are available.
DeviceIDs() should only be
called after at least one Enumerate().
MEGA-D and Dual DCAM devicees can be intermixed on the same bus. However, SVS loads only a
single video driver, so any particular SVS application will see only the MEGA-Ds or the Dual DCAMs.
5.6.3 Opening and Closing
bool Open(char *name = NULL)
bool Open(int devnum)
bool Close()
Before images can be input from a stereo device, the device must be opened. The Open() call opens
the device, returning true if the device is available. An optional name can be given to distinguish among
several existing devices. The naming conventions for devices depend on the type of device; typically it is a
serial number or other identifier. These identifiers are returned by the
Enumerate() call. Alternatively,