Info

この質問は閉じられています。 編集または回答するには再度開いてください。

regarding use of camera of laptop when asked?

2 ビュー (過去 30 日間)
gaurav porwal
gaurav porwal 2012 年 8 月 30 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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')
i want to use a if statement in which i will be asked to open camera for capturing image and to save it to a particular place, and if not camera will not be opened, with a statement of sorry

回答 (2 件)

Rolfe Dlugy-Hegwer
Rolfe Dlugy-Hegwer 2012 年 8 月 30 日
Good question, Guarav. It sounds like you want to combine MATLAB's input function with manual triggering in Image Aquisition Toolbox.

Sean de Wolski
Sean de Wolski 2012 年 8 月 30 日
How about using a questdlg to ask the user?
button = questdlg('Would you like to open the camera?','Camera Control','Yes!','No','No')
  1 件のコメント
Rolfe Dlugy-Hegwer
Rolfe Dlugy-Hegwer 2012 年 8 月 30 日
Even better. questdlg

Community Treasure Hunt

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

Start Hunting!

Translated by