rotating image using app designer
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, I need some help in rotating an image when using a buttom to rotate. I know that I have to use imrotate but im am not sure where to go from here.
% Button pushed function: RotateButton
function rotate(app, event)
app.img2 = imrotate(app.img, 90);
imshow(app.img2);
end
end
this is what I have so far, img is for the orginal image use.
0 Commenti
Risposte (1)
Image Analyst
il 17 Apr 2024
Assuming you have an image variable, not a widget on the UI, called app.img, it should work. But I don't know what app.img is. Did you assign an image as a new field of the app structure? If so that should work. But if img is the name of an axes control that you placed on the UI window that would not work. You would need to get your actual image variable and rotate it and then display it. Something like
rgbImage = imread('peppers.png');
rgbImage = imrotate(rgbImage, 90); % Rotate it and put it back in the same variable.
imshow(rgbImage, 'Parent', app.img); % Display it in the "img" axes control on the GUI.
0 Commenti
Vedere anche
Categorie
Scopri di più su Environment and Settings in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!