what code should i make for a reset, bit plane & grayscale push button for the following code?

1 view (last 30 days)
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 .

Answers (1)

Geoff Hayes
Geoff Hayes on 23 Jul 2016
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.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!