how to take image as a user input from folder?

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?

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 3 de Feb. de 2014

0 votos

You can use uigetfile and copyfile functions

3 comentarios

romasha
romasha el 3 de Feb. de 2014
Editada: Azzi Abdelmalek el 3 de Feb. de 2014
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
Azzi Abdelmalek
Azzi Abdelmalek el 3 de Feb. de 2014
Editada: Azzi Abdelmalek el 3 de Feb. de 2014
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]);
romasha
romasha el 3 de Feb. de 2014
thanx alot azzi

Iniciar sesión para comentar.

Más respuestas (2)

Alex Taylor
Alex Taylor el 3 de Feb. de 2014

0 votos

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

Categorías

Más información sobre Convert Image Type en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 3 de Feb. de 2014

Respondida:

el 14 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by