I'm creating an Image Editing Program using Matlab. The user uploads the image in one pushbutton callback function. The user can then use other pushbutton callbacks to edit the image (rotate, change into black and white etc).
Whilst I can access the image, and successfully edit it individually, it always reverts back to its original uploaded state. For example - if I were to rotate it first, then change to black and white the rotation would disappear and vice versa.
I am using:
handles=guidata(hObject);
at the beginning of every function. And
guidata(hObject, handles);
at the end of every function, but the functions always access the originally uploaded image.
How can I successfully update the image handle after every edit???
Here is an example of a callback function:
function pushbutton3_Callback(hObject, eventdata, handles)
handles=guidata(hObject);
I = rgb2gray(handles.im)
himage = imshow(I, 'Parent', handles.axes1);
guidata(hObject, handles);