目标:在matlab中GUI环境下通过摄像头读入视频并实时处理(实时可能比较困难)
1、建立GUI界面,通过摄像头读取视频,并灰度化处理。 完整的m文件如下。(matlab2010a)
function varargout = faceDetection(varargin)
% FACEDETECTION M-file for faceDetection.fig
% FACEDETECTION, by itself, creates a new FACEDETECTION or raises the existing
% singleton*.
%
% H = FACEDETECTION returns the handle to a new FACEDETECTION or the handle to
% the existing singleton*.
%
% FACEDETECTION('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FACEDETECTION.M with the given input arguments.
%
% FACEDETECTION('Property','Value',...) creates a new FACEDETECTION or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before faceDetection_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to faceDetection_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help faceDetection
% Last Modified by GUIDE v2.5 25-Jan-2014 15:26:28
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @faceDetectio