1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| % --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
background=getsnapshot(obj);
imwrite(background,'filename3.bmp')
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close all
info = imaqhwinfo('winvideo');
%%capture d image
obj = videoinput('winvideo', 1);
preview(obj) |
Partager