% Update Handles Structure: If Try
% Update Handles Structure: If Try
handles.output = hObject; % Update handles structure handles.rgb = []; handles.noback = []; guidata(hObject, handles); % This sets up the video camera and starts the preview % Only do this when it's invisible if strcmp(get(hObject,'Visible'),'off') try handles.vidobj = videoinput('winvideo'); % Update handles structure start(handles.vidobj); guidata(hObject, handles); vidRes = get(handles.vidobj, 'VideoResolution'); nBands = get(handles.vidobj, 'NumberOfBands'); hImage = image(zeros(vidRes(2), vidRes(1), nBands), 'Parent',... handles.camarav); preview(handles.vidobj,hImage); catch msgbox('NO HAY CMARA CONECTADA. Cargando Profile.jpg.')
hImage = image(imread('profile.jpg'), 'Parent',handles.camarav);
end end