Borrar filtros
Borrar filtros

Howto updated/manipulated image between the callbacks

1 visualización (últimos 30 días)
Lluis Roca
Lluis Roca el 14 de Oct. de 2013
Comentada: Walter Roberson el 14 de Oct. de 2013
Hi,
I have several push buttons that performs image analysis (e.g., load an image, convert to gray scale). I wish to share the updated/manipulated image between the callbacks but I get an error.
Therefore, how can I update the image and share it between the callbacks?
Code for example:
function loadImageButton_Callback(hObject, eventdata, handles)
% hObject handle to loadImageButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I = imread('D:\Image\tele.jpg');
axes(handles.imageAxes);
imshow(I);
guidata(hObject, handles);
function convertGSbutton_Callback(hObject, eventdata, handles)
% hObject handle to convertGSbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I = rgb2gray(I);
axes(handles.imageAxes);
imshow(I);
guidata(hObject, handles);
Thanks

Respuesta aceptada

Walter Roberson
Walter Roberson el 14 de Oct. de 2013
  2 comentarios
Lluis Roca
Lluis Roca el 14 de Oct. de 2013
Thanks.
I used the SETAPPDATA and GETAPPDATA.
What would be my 'yourVariable' in my case?
Walter Roberson
Walter Roberson el 14 de Oct. de 2013
The data you want shared. "I" in this case.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by