MATLAB GUI - error in display

조회 수: 1 (최근 30일)
MUHAMMAD HAFIS
MUHAMMAD HAFIS 2013년 4월 14일
i'm trying to make GUI that will display a live camera from a webcam... unfortunately the output display is not working.. can anyone tell me where i made my mistake and how do i correct it?
this is my code
% --- Executes just before Based is made visible. function Based_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to Based (see VARARGIN)
% Choose default command line output for Based handles.output = hObject;
handles.video = videoinput('winvideo', 1); handles.video.ReturnedColorspace = 'rgb'; handles.video.FramesPerTrigger = Inf;
% Update handles structure guidata(hObject, handles);
% UIWAIT makes Based wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = Based_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure handles.output = hObject; varargout{1} = handles.output;
% --- Executes on button press in Camera. function Camera_Callback(hObject, eventdata, handles) % hObject handle to Camera (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) if strcmp(get(handles.Camera,'String'),'Start Camera') % Camera is off. Change button string and start camera. set(handles.Camera,'String','Stop Camera') start(handles.video)
else % Camera is on. Stop camera and change button string. set(handles.Camera,'String','Start Camera') stop(handles.video)
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 View and Analyze Simulation Results에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by