why image take much time in appearing on gui fig?
1 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
回答(1 个)
Image Analyst
2014-2-21
编辑:Image Analyst
2014-2-21
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);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!