saving an image in a specific folder
    1 次查看(过去 30 天)
  
       显示 更早的评论
    
Hello,
i'm trying to save an image to a specific folder, however when i save the image i would like to give it any name i want.
similar to saving a word document, and a dialogue box pops up and asks you where would you like the destination folder and the name of the file
0 个评论
采纳的回答
  Stephen23
      
      
 2018-5-17
        
      编辑:Stephen23
      
      
 2018-5-17
  
      [F,P] = uiputfile();
imwrite(I,fullfile(P,F))
8 个评论
  Image Analyst
      
      
 2018-5-17
				Try this fix
if ~contains(F, '.tif', 'IgnoreCase', true)
   % User did not enter the .tif extension.  add it for them.
    F = [F, '.tif']; % Append .tif
end
fullFileName = fullfile(P, F);
imwrite(I, fullFileName);
更多回答(2 个)
  Image Analyst
      
      
 2018-5-17
        You can use imsave():
img = imread('peppers.png');
imshow(img); % Display image
[filename, user_canceled] = imsave();
Or else the longer way with uiputfile():
% Get the name of the file that the user wants to save.
% Note, if you're saving an image you can use imsave() instead of uiputfile().
startingFolder = userpath % Or "pwd" or wherever you want.
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(yourImage, fullFileName);
0 个评论
  akshatha nayak
 2019-4-23
        How to take real world image of person eye and store it in mysql database and use that image for comparing with other image ?
1 个评论
  Image Analyst
      
      
 2019-4-23
				Start a new question with this, and BE SURE to add the database tag, and DatabaseToolbox product when you post it.
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



