matlab videoinput 函数,Create video input object

videoinput

Create video input object

Syntax

obj = videoinput(adaptorname)

obj = videoinput(adaptorname,deviceID)

obj = videoinput(adaptorname,deviceID,format)

obj = videoinput(adaptorname,deviceID,format,P1,V1,...)

Description

obj = videoinput(adaptorname) constructs

the video input object obj. A video input object

represents the connection between MATLAB® and

a particular image acquisition device. adaptorname is

a character vector that specifies the name of the adaptor used to

communicate with the device. Use the imaqhwinfo function

to determine the adaptors available on your system.

obj = videoinput(adaptorname,deviceID) constructs

a video input object obj, where deviceID is

a numeric scalar value that identifies a particular device available

through the specified adaptor, adaptorname.

Use the imaqhwinfo(adaptorname) syntax

to determine the devices available through the specified adaptor.

If deviceID is not specified, the first available

device ID is used. 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,format) constructs

a video input object, where format is a

character vector that specifies a particular video format supported

by the device or the full path of a device configuration file (also

known as a camera file).

To get a list of the formats supported by a particular device,

view the DeviceInfo structure for the device that

is returned by the imaqhwinfo function. Each DeviceInfo structure

contains a SupportedFormats field. If format is

not specified, the device's default format is used.

When the video input object is created, its VideoFormat field

contains the format name or device configuration file that you specify.

obj = videoinput(adaptorname,deviceID,format,P1,V1,...) 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 name and property value pairs can be in any format

supported by the set function, i.e., parameter/value

character vector pairs, structures, or parameter/value cell array

pairs.

To view a complete listing of video input object functions and

properties, use the imaqhelp function.

imaqhelp videoinput

In the documentation, see Image Acquisition Toolbox Properties for links

to the property reference pages.

Examples

Construct a video input object.

obj = videoinput('matrox', 1);

Select the source to use for acquisition.

obj.SelectedSourceName = 'input1'

View the properties for the selected video source object.

src_obj = getselectedsource(obj);

get(src_obj)

Preview a stream of image frames.

preview(obj);

Acquire and display a single image frame.

frame = getsnapshot(obj);

image(frame);

Remove video input object from memory.

delete(obj);

Tips

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.

Note

To get a list of options you can use on a function, press the Tab key

after entering a function on the MATLAB command line. The list

expands, and you can scroll to choose a property or value. For information

about using this advanced tab completion feature, see Using Tab Completion for Functions.

Introduced before R2006a

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值