Plot image in 2d plain and apply operations like translation/rotation and reflection
1 次查看(过去 30 天)
显示 更早的评论
I want to read an image on matlab and on 2d plain perform changes of its coordinates as I would have done on a graph
img = imread('img.png');
sz = size(img);
imshow(img);
I am very new to matlab and do not understand much too. I know that imread will get 3d matrix. First 2 with original values
and the last for RGB.
Those are color values and I do not thin that can be used to apply rotation or translation
Below is the example oof what I actually want to do.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1563199/image.png)
0 个评论
回答(2 个)
Image Analyst
2023-12-8
编辑:Image Analyst
2023-12-8
rgbImage = imread('peppers.png');
title('Original')
nexttile
imshow(rgbImage);
img2 = imrotate(rgbImage, 90);
title('Rotated')
nexttile
imshow(img2);
img3 = flipud(rgbImage);
nexttile
imshow(img3);
title('Flipped top-to-bottom about horizontal axis')
For more sophisticated transforms, see Steve's blog:
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!