How to do image rotation in matlab?
4 ビュー (過去 30 日間)
古いコメントを表示
How to make gui for image rotation.i need the code to get image rotated at every time i press pushbutton when i upload an image.
a=getappdata(0,'a');
aclock=a;
aclock=imrotate(aclock,270);
axes(handles.axes1);
imshow(aclock);
2 件のコメント
Rik
2019 年 6 月 23 日
This code looks like it should work. What is your question? What isn't this code doing that you want it to do?
Rik
2019 年 6 月 23 日
Comment mistakenly posted as answer by Nimra Azmat:
it only rotate the image once and when i move it on the other angle (anticlock) it process the orignal image i want my code to change the orginal image and change it according to button press on any command
採用された回答
Rik
2019 年 6 月 23 日
It is a bit strange to store your image with getappdata on the graphics root, instead of with guidata. You will also notice that you aren't actually saving the result anywhere, so the function you've written only rotates the original image.
If you want to rotate the image in every callback, you need to store your image back somewhere, so in your case something like this should work:
a=getappdata(0,'a');
aclock=a;
aclock=imrotate(aclock,270);
axes(handles.axes1);
imshow(aclock);
setappdata(0,'a',aclock)
0 件のコメント
その他の回答 (1 件)
NAJMA FAYAZ
2020 年 10 月 30 日
Try This
global a
a=imrotate(a,270);
axes(handles.axes1);
imshow(a);
1 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!