Image Acquisition Toolbox Previous page   Next Page
videoinput

Create a video input object

Syntax          

Description

obj = videoinput('adaptorname')
obj = videoinput('adaptorname',deviceID)
obj = videoinput('adaptorname',deviceID,'format')
constructs a video input object obj, where

'adaptorname'
String specifying the device adaptor obj is associated with. Valid values can be determined by using the imaqhwinfo function.
'deviceID'
Numerical device identifier. If deviceID is not specified, the first available device ID is used.
'format'
String specifying the video format for obj. If format is not specified, the device's default format is used.

Valid deviceID and format values, as well as the default format, can be determined by using the imaqhwinfo('adaptorname') syntax.

Upon creation, the object's VideoFormat property reflects the specified format. The toolbox chooses the first available video source object as the selected source and specifies this video source object's name in the object's SelectedSourceName property. Use getselectedsource(obj) to access the video source object that is used for acquisition.

As a convenience, a device's name can be used in place of the deviceID. If multiple devices have the same name, the first available device is used.

obj = videoinput('adaptorname',deviceID,'devicefilename') constructs a video input object using a device configuration file, devicefilename, as the video format. The object's VideoFormat property reflects the devicefilename and its path.

obj = videoinput('adaptorname',deviceID,'format','P1',V1,'P2', V2,...)
obj = videoinput(
'adaptorname',deviceID,'devicefilename','P1',V1, 'P2',V2,...)
creates a video input object obj with the specified property values. If an invalid property name or property value is specified the object is not created.

The property value pairs can be in any format supported by the set function, i.e., parameter/value string pairs, structures, or parameter/value cell array pairs.

To view a complete listing of video input object functions and properties, use the imaqhelp function.

Example

Construct a video input object.

Select the source to use for acquisition.

View the properties for the selected video source object.

Preview a stream of image frames.

Acquire and display a single image frame.

Remove video input object from memory.

See Also

delete, imaqfind, isvalid, preview


Previous page  triggerinfo wait Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS