regarding use of camera of laptop when asked?

1 vue (au cours des 30 derniers jours)
gaurav porwal
gaurav porwal le 30 Août 2012
button=questdlg('would you like to open the camera?','vid','yes!','no','no'); if button== yes; vid=videoinput('winvideo',1,'YUY2_640x480'); set(vid,'ReturnedColorSpace','rgb'); preview(vid) start(vid); im=getdata(vid,1); figure,imshow(im) imwrite(im,'xyz3.jpg') elseif button == no; end how i can correct this code,my camera is working with this code, i want to use dialouge box yes for camera on, and no for end

Réponses (1)

Image Analyst
Image Analyst le 30 Août 2012
Try this:
promptMessage = sprintf('Do you want to use the camera?');
titleBarCaption = 'Use Camera?';
button = questdlg(promptMessage, titleBarCaption, 'Yes', 'No', 'Yes');
if strcmp(button, 'Yes')
% Set up the camera.
else
% Shutdown the camera or simply return.
end

Catégories

En savoir plus sur MATLAB Support Package for IP Cameras dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by