matlab中webcam,MATLAB编程-MATLAB2014a的webcam操作

由于MATLAB2014a安装的是免费版,在用videoinput时便出现问题如下:

imaqhwinfo

警告: No Image Acquisition adaptors found. Image acquisition adaptors may be available as downloadable support packages. Open Support

Package Installer to install additional vendors.

ans =

InstalledAdaptors: {}

MATLABVersion: '8.3 (R2014a)'

ToolboxName: 'Image Acquisition Toolbox'

ToolboxVersion: '4.7 (R2014a)'

于是安装webcam来解决读取摄像头问题:

b3bf36cf04da6c34f2c2c89a4b89d38e.png

点击:Get Hardware Support Packages

19c7dfa924d00d9a985e0f24da9792d2.png

出现以上的界面,点击USB Webcams 安装。

安装后:

help webcam

webcam 的内容:

webcam - Creates webcam object to acquire frames from your Webcam.

Webcam support.

Webcam functions.

webcam - Creates webcam object to acquire frames from your webcam.

webcamlist - Returns a list of all webcams connected to the system.

webcam 既是目录也是函数。

webcam Creates webcam object to acquire frames from your Webcam.

CAMOBJ = webcam returns a webcam object, CAMOBJ, that acquires images

from the specified Webcam. By default, this selects the first

available Webcam returned by WEBCAMLIST.

CAMOBJ = webcam(DEVICENAME) returns a webcam object, CAMOBJ, for

Webcam with the specified name, DEVICENAME. The Webcam name can be

found using the function WEBCAMLIST.

CAMOBJ = webcam(DEVICEINDEX) returns a webcam object, CAMOBJ, for

Webcam with the specified device index, DEVICEINDEX. The Webcam device

index is the index into the cell array returned by WEBCAMLIST.

CAMOBJ = webcam(..., P1, V1, P2, V2,...) constructs the webcam object,

CAMOBJ, with the specified property values. If an invalid property

name or property value is specified, the webcam object is not created.

Creating webcam object obtains exclusive access to the Webcam.

SNAPSHOT method syntax:

IMG = snapshot(CAMOBJ) acquires a single frame from the Webcam.

[IMG, TIMESTAMP] = snapshot(CAMOBJ) returns the frame, IMG, and the

acquisition timestamp, TIMESTAMP.

webcam methods:

snapshot - Acquire a single frame from the Webcam.

preview - Activate a live image preview window.

closePreview - Close live image preview window.

webcam properties:

Name - Name of the Webcam.

Resolution - Resolution of the acquired frame.

AvailableResolutions - Cell array of list of available resolutions.

The webcam interface also exposes the dynamic properties of the Webcam

that we can access programmatically. Some of these dynamic properties

are Brightness, Contrast, Hue, Exposure etc. The presence of these

properties in the webcam object depends on the Webcam that you connect

to.

Example:

% Construct a webcam object

camObj = webcam;

% Preview a stream of image frames.

preview(camObj);

% Acquire and display a single image frame.

img = snapshot(camObj);

image(img);

See also webcamlist

根据help来看:

0d5cf10ac39741efbff89257f3281bd9.png

至此调用成功。

》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值