MATLAB Answers

0

how to take image as a user input from folder?

Asked by romasha on 3 Feb 2014
Latest activity Answered by waseem almuhtaseb on 14 Feb 2019
hi, i want to take an image from user as an input and selected/input image is saved to another new folder.. how can i do this?

  0 Comments

Sign in to comment.

Products

3 Answers

Answer by Azzi Abdelmalek
on 3 Feb 2014
 Accepted Answer

You can use uigetfile and copyfile functions

  3 Comments

i use the following code code
image=uigetfile(['*.bmp'],'C:\Users\Romesha\Desktop\2');
copyfile('C:\Users\Romesha\Desktop\2','C:\Users\Romesha\images');
but it copies all the images of source folder to destination folder whereas i want that image which i select on clicking in source folder like: if i clicked on image named 'gray.bmp' only this image get save in destination folder
ext='*.bmp'
folder='C:\Users\Romesha\Desktop\2';
image=uigetfile([folder '\' ext])
old_image=fullfile(folder,image)
copyfile(old_image,['C:\Users\Romesha\images\' image]);
thanx alot azzi

Sign in to comment.


Answer by Alex Taylor on 3 Feb 2014

Depending on your exact use case, I'd also recommend looking at the imsave and imputfile functions exposed by the Image Processing Toolbox.

  0 Comments

Sign in to comment.


Answer by waseem almuhtaseb on 14 Feb 2019

[path,~]=imgetfile();
Im=imread(path);
Im=im2double(Im);

  0 Comments

Sign in to comment.