Call a folder from desktop and use images inside it
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
HEMRAJ PATEL
el 29 de Nov. de 2021
Respondida: yanqi liu
el 30 de Nov. de 2021
I want to make a programme where i can call a file from desktop and them use images stored in it in the same programme.
0 comentarios
Respuesta aceptada
Wan Ji
el 29 de Nov. de 2021
Hey, friend,
Using uigetfile is a nice choice, for example
[file,path,indx] = uigetfile( ...
{'*.jpg;*.png;*.tiff;*.tif;*.bmp',...
'Image Files (*.jpg;*.png;*.tiff;*.tif;*.bmp)'; ...
'*.*','All Files (*.*)'}, ...
'Select a File');
% Then use imread to read the image
I = imread([path, file]);
0 comentarios
Más respuestas (1)
yanqi liu
el 30 de Nov. de 2021
% read
[filename, pathname, ~] = uigetfile( ...
{ '*.bmp;*.jpg;*.tif;*.png;*.gif','All Image Files';...
'*.*', 'all files (*.*)'}, ...
'choose file', ...
'MultiSelect', 'off', ...
'C:\Users\Administrator\Desktop\');
filePath = 0;
if isequal(filename, 0) || isequal(pathname, 0)
return;
end
filePath = fullfile(pathname, filename)
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!