what code should i make for a reset, bit plane & grayscale push button for the following code?
3 次查看(过去 30 天)
显示 更早的评论
as i have 2 axes one is for original image & 2 is for processed image. the code for loading the image by the user on 1 axis is mentioned below:
axes(handles.org);
[fn pn] = uigetfile('*.jpg','select image');
if fn == 0
msgbox('NO FILE SELECTED');
else
handles.I = imread(fullfile(pn,fn));
imshow(handles.I);
set(handles.proce,'visible','off');
set(handles.text5,'String','');
end
now i want code for all the 3 push buttons that i mentioned in my question bt remember one thing that the code for reset button should be like this so that when i clicked on it it will give original image on 2 axis. whenever i used this code for grayscale push button nothing is going to be done.
handles.grayscale =im2gray(handles.I);
axes(handles.proce);
imshow(handles.grayscale);
similarly when i m using this code for reset button also nothing done.
axes(handles.proce);
imshow(handles.I);
is their anything wrong with this code? if it is mention the code for all the 3 buttons .
0 个评论
回答(1 个)
Geoff Hayes
2016-7-23
Abhishek - are you observing any problems with the above code? If so, what are they? If you are using GUIDE to create your GUI, then every time you update the handles structure, you will need to save those changes to it using
guidata(hObject,handles);
This way, the original image I will be available to the other callbacks.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!