MATLAB GUI - error in display
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on View and Analyze Simulation Results in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!