码迷,mamicode.com
首页 > Web开发 > 详细

MATLAB编程->MATLAB2014a的webcam操作

时间:2014-09-26 12:39:28      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:matlab webcam vide

   

     由于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来解决读取摄像头问题:

bubuko.com,布布扣

点击:Get Hardware Support Packages

bubuko.com,布布扣

出现以上的界面,点击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来看:

bubuko.com,布布扣

至此调用成功。

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



MATLAB编程->MATLAB2014a的webcam操作

标签:matlab webcam vide

原文地址:http://blog.csdn.net/sunboyiris/article/details/39576375

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!