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

1 回表示 (過去 30 日間)
Abhishek Ghai
Abhishek Ghai 2016 年 7 月 11 日
回答済み: Geoff Hayes 2016 年 7 月 23 日
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 .

回答 (1 件)

Geoff Hayes
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.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by