Filter löschen
Filter löschen

Rotate image using slider in Matlab

2 Ansichten (letzte 30 Tage)
monkey_matlab
monkey_matlab am 9 Okt. 2017
Beantwortet: Walter Roberson am 9 Okt. 2017
Hello, I am attempting to rotate an image in Matlab GUI using a slider. I tried to follow the directions given in the stack exchange website but I get an error when implementing their process of..."In the figure's xxxx_OpeningFcn function, read and store the image in the handles structure, then show it:"
handles.I = imread('cameraman.tif');
imshow(I, 'Parent',findobj(hObject,'Tag','imgAxis')) %# use tag you assigned
guidata(hObject, handles); %# Update handles structure
I named my slider 'steer' and my axes 'steering'. Can you direct me as to how to proceed to get the image to rotate. I have included my fig files etc. Please let me know what I need to correct in the code to get the image to load properly and then rotate it. Thanks.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Okt. 2017
You have
handles.I = imread('cameraman.tif');
That stores the image into handles.I
imshow(I, 'Parent',findobj(hObject,'Tag','imgAxis')) %# use tag you assigned
that tries to use the image from I, not from handles.I . The I should be changed to handles.I

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by