regarding use of camera of laptop when asked?
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Image Analyst
on 30 Aug 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
0 Comments
See Also
Categories
Find more on MATLAB Support Package for IP Cameras 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!