Is there any function like 'uigetfile' or 'uiopen' so that I can chose an Image of my own choice each time I want to process an Image with out using 'imread()'

8 views (last 30 days)
Hello,
I am doing some image processing. If I use 'imread('img.jpg') I have to specify the name in advance. I have images under different names so it requires me to change the name in imread() every time I run the code. I want to ask if there is any other function such as 'uiopen' or 'uigetfile' so that I can select the image of my choice when I run the script file.
Thanks.

Accepted Answer

Walter Roberson
Walter Roberson on 1 Oct 2015
[filename, directory] = uigetfile('Select an image');
complete_name = fullfile(directory, filename);
TheImage = imread(complete_name);

More Answers (0)

Community Treasure Hunt

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

Start Hunting!