GUI to set folder path then to select an image

8 ビュー (過去 30 日間)
hamed abdulaziz
hamed abdulaziz 2014 年 5 月 13 日
コメント済み: Image Analyst 2019 年 10 月 23 日
Hi all,
I have many images in a folder and I need a piece of code to create an GUI for a set that folder path then to select one image,all images are .Bmp type,thanks in advance.

回答 (4 件)

Dishant Arora
Dishant Arora 2014 年 5 月 13 日
編集済み: Dishant Arora 2014 年 5 月 13 日
path = 'c:\users\userName\my documents\matlab';
filter = '*.bmp';
selectedFile = uigetfile(fullfile(path , filter));
imshow(selectedFile)
  4 件のコメント
hamed abdulaziz
hamed abdulaziz 2014 年 5 月 13 日
thank you,I need to make path is dynamically(i.e. for any path not specified),and by the way how can I put the above code in push button callback could you explain that in code? ;because I am new on Matlab,thanks
Dishant Arora
Dishant Arora 2014 年 5 月 15 日
Here are some guide tutorials to start with: http://www.mathworks.in/discovery/matlab-gui.html

サインインしてコメントする。


Image Analyst
Image Analyst 2014 年 5 月 13 日
This GUI will help the novice user get up to speed very quickly on using GUI-based applications. Everything is laid out in a very simple Step 1, Step 2, Step 3, etc. layout. It is a very good starting point for a typical image analysis application. This application uses GUIDE to do the user interface design, and has most of the basic controls such as buttons, listboxes, checkboxes, radio buttons, scrollbars, etc. It allows the user to select a folder of images, select one or more images and display them, to select a series of options, and to individually or batch process one or more images. The user can ......................
  2 件のコメント
Franchesca
Franchesca 2014 年 5 月 13 日
Hi,
could you please help me with the questions i posted regarding GUI, i am completely stuck.
Franchesca
Image Analyst
Image Analyst 2014 年 5 月 13 日
You didn't post a question here. You posted an Answer to hamed that says [filename,filepath]=uigetfile({'*.bmp'},'Load Matlab File');
What is the link to your question that's not been answered yet?

サインインしてコメントする。


Franchesca
Franchesca 2014 年 5 月 13 日
[filename,filepath]=uigetfile({'*.bmp'},'Load Matlab File');

naing naing9
naing naing9 2019 年 10 月 22 日
Hi. I have many folders in current directory, in which test images of each person. When i pressed pushbutton in guide, i want to choose which folder and which image for test. what can i do? Please, help me.
  1 件のコメント
Image Analyst
Image Analyst 2019 年 10 月 23 日
Try this. Adapt as needed.
% Have user browse for a file, from a specified "starting folder."
% For convenience in browsing, set a starting folder from which to browse.
startingFolder = pwd; % or 'C:\wherever';
if ~exist(startingFolder, 'dir')
% If that folder doesn't exist, just start in the current folder.
startingFolder = pwd;
end
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by