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 次查看(过去 30 天)
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);

采纳的回答

Image Analyst
Image Analyst 2018-6-10

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by