imrotate in Matlab App Desinger
7 views (last 30 days)
Is it possible to rotate an image in Matlab app designer?
I input an image using the following code:
% Code that executes after component creation
imag = imread('cameraman.tif');
handles.I = imresize(imag,0.75);
How to now rotate the image using a slider.
Under the slider code, I have tried the following but could not get it to work:
% Value changing function: SteeringSlider
function SteeringSliderValueChanging(app, event)
changingValue = event.Value;
angle = round(event.Value);
imshow( imrotate(app.UIAxes,angle,'bilinear','crop') );
Can you tell me how to rotate an image in Matlab App Designer? Thanks.
Sean de Wolski on 17 Oct 2017
You're calling imshow on the uiaxes not the image. I would manage this like this:
app.UIAxes = uiaxes; % You won't need this in app designer since it's already there
im = imread('cameraman.tif');
imh = imshow(im, 'Parent', app.UIAxes);
for angle = 0:10:360
imh.CData = imrotate(im,angle,'bilinear','crop');
Store imh and im as properties of your app.