필터 지우기
필터 지우기

Plot image in 2d plain and apply operations like translation/rotation and reflection

조회 수: 3 (최근 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.

답변 (2개)

Matt J
Matt J 2023년 12월 8일
편집: Matt J 2023년 12월 8일
  댓글 수: 4
Farhan
Farhan 2023년 12월 8일
can you provide an example, as I am new to matlab
Matt J
Matt J 2023년 12월 8일
편집: Matt J 2023년 12월 8일
rgbImage = imread('peppers.png');
T = [0.6428 -0.7660 0
0.7660 0.6428 0
0 0 1.0000 ]; %transformation matrix
tform=simtform2d(T);
imshow(imwarp(rgbImage,tform))

댓글을 달려면 로그인하십시오.


Image Analyst
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:

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by