Retrieve Hardware Information: Determining The Adaptor Name
Retrieve Hardware Information: Determining The Adaptor Name
imaqhwinfo
ans =
info = imaqhwinfo('dcam')
info =
dev_info = imaqhwinfo('dcam',1)
dev_info =
DefaultFormat: 'F7_Y8_1024x768'
DeviceFileSupported: 0
DeviceName: 'XCD-X700 1.05'
DeviceID: 1
ObjectConstructor: 'videoinput('dcam', 1)'
SupportedFormats: {'F7_Y8_1024x768' 'Y8_1024x768'}
Create a Video Input Object
The following example creates a video input object for the DCAM adaptor. Substitute the
adaptor name of the image acquisition device available on your system.
vid = videoinput('dcam',1,'Y8_1024x768')
The videoinput function accepts three arguments: the adaptor name, device ID, and video format.
You retrieved this information in step 2. The adaptor name is the only required argument; the
videoinput function can use defaults for the device ID and video format. To determine the default
video format, look at the DefaultFormat field in the device information structure.
To view a summary of the video input object you just created, enter the variable name (vid) at
the MATLAB command prompt.
vid
To preview the video stream in this example, enter the preview function at the MATLAB
prompt, specifying the video input object created in step 3 as an argument.
preview(vid)
imaqtool