フィルターのクリア

Save image name as input from user

1 回表示 (過去 30 日間)
Sagar
Sagar 2014 年 12 月 8 日
回答済み: Adam 2014 年 12 月 8 日
I'm capturing image through webcam, I want to save the image name as input from user
prompt = {'Enter Name:'};
dlg_title = 'Input';
num_lines = 1;
answer = inputdlg(prompt,dlg_title,num_lines);
vid = videoinput('winvideo',1);
imagename = 'C:\Program Files\MATLAB\R2013a\bin\test.tif';
img=getsnapshot(vid);
imwrite(img, imagename);
How to name it as input from user in '.tif' format?

回答 (1 件)

Adam
Adam 2014 年 12 月 8 日
imagename = [answer '.tif']
if you just want to append .tif.
Personally I would use uiputfile though rather than write my own inputdlg. Then you can specify .tif via the filterspec argument.

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by