Clear Filters
Clear Filters

why image take much time in appearing on gui fig?

1 view (last 30 days)
hello, i designed a gui in which,on push button there is a folder"same iris" opens and select an image and this show on gui fig but problem is that image take much time in appearing on gui fig what it is happening kindly help .. my code is given below Code function pushbutton1_Callback(~, ~, ~) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) ext='*.bmp'; folder='same iris'; image=uigetfile([folder '\' ext]); old_image=fullfile(folder,image); img=imread(old_image);imshow(img);

Answers (1)

Image Analyst
Image Analyst on 21 Feb 2014
Edited: Image Analyst on 21 Feb 2014
This should not take a long time. Normally it happens virtually instantly for me. For some images, like a 63 MB linescan image I sometimes work with, it can take 2-4 seconds to read it in and downsize it for display. Perhaps it's causing a delay because you picked a reserved function name "image" for the name of your image variable. When you do that it destroys the image() function and maybe that causes some delay. Or it has to figure out what to do. Pick another name so there is no conflict, like baseFileName or something.
baseFileName = uigetfile([folder '\' ext]);
old_image = fullfile(folder, baseFileName);


Find more on Image Processing Toolbox in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!