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 visualización (últimos 30 días)
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);

Respuesta aceptada

Image Analyst
Image Analyst el 10 de Jun. de 2018

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by