標籤:matlab webcam vide
由於MATLAB2014a安裝的是免費版,在用videoinput時便出現問題如下:
imaqhwinfo警告: No Image Acquisition adaptors found. Image acquisition adaptors may be available as downloadable support packages. Open SupportPackage Installer to install additional vendors. ans = InstalledAdaptors: {} MATLABVersion: '8.3 (R2014a)' ToolboxName: 'Image Acquisition Toolbox' ToolboxVersion: '4.7 (R2014a)'
於是安裝webcam來解決讀取網路攝影機問題:
點擊:Get Hardware Support Packages
出現以上的介面,點擊USB Webcams 安裝。
安裝後:
help webcamwebcam 的內容: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來看:
至此調用成功。
》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
MATLAB編程->MATLAB2014a的webcam操作