Saving Images

2 ビュー (過去 30 日間)
Tarik Razak
Tarik Razak 2012 年 2 月 13 日
Hi I have following code that takes images and saves them, problem is that for each image i have to select the folder and file name to save it in. I am trying to give it path of the folder to save in and format and it saves them automatically ..any ideas how to do that? Thanks
figure for n=1:Ne [r,c] = find(L==n); n1=imagen(min(r):max(r),min(c):max(c)); h=imshow(~n1); imsave(h); pause(0.5) end

回答 (1 件)

Image Analyst
Image Analyst 2012 年 2 月 13 日
Why not use uiputfile and imwrite()?
% Get the name of the file that the user wants to save.
startingFolder = userpath
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uiputfile(defaultFileName, 'Specify a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
imwrite(yourImageMatrix, fullFileName );

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by