i have an image which i call using a pushbutton and i want to use the same image in another pushbutton but with a code to alter its composition like imbinarize

1 view (last 30 days)
function pushbutton1_Callback(hObject, eventdata, handles) % 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) global I [filename, pathname] = uigetfile({'.jpg';'.tif';'.png'}); I = strcat(pathname, filename); figure imshow(I),title('Original');
function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %global I; handles.img = imread(FileName); Bw=uint8(handles.img); BW = im2bw(Bw, 0.5); figure,imshow(BW); %imwrite(BW,'im2bw.tif'); guidata(hObject,handles);

Accepted Answer

Image Analyst
Image Analyst on 10 Jun 2018

More Answers (0)

Categories

Find more on Interactive Control and Callbacks 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!