3D roataion of image (jpg image)

8 ビュー (過去 30 日間)
L
L 2012 年 1 月 25 日
移動済み: DGM 2023 年 2 月 20 日
Dear All,
How can I rotate in 3D the jpg image in Matlab. The imrotate does it only in 2D? I found the rotate function and 3D rotate, but I don't know could I use these 2 functions for this problem! Thank You in advance!
Laslo

採用された回答

Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 25 日
Hi,
in Matlab R20011a, I don't face any problem with imrotate to rotate 3D image
I = imread('football.jpg'); %3D image
J = imrotate(I,30);
imshow(J);
But, you also can rotate it by :
I = imread('football.jpg'); %3D image
s = 30;
J(:,:,1) = imrotate(I(:,:,1),s);
J(:,:,2) = imrotate(I(:,:,2),s);
J(:,:,3) = imrotate(I(:,:,3),s);
imshow(J);
  2 件のコメント
slama najla
slama najla 2012 年 6 月 16 日
移動済み: DGM 2023 年 2 月 20 日
hello i try imrotate us on 2d but it change the size of the 3d image, is it normal or no
Image Analyst
Image Analyst 2012 年 6 月 16 日
移動済み: DGM 2023 年 2 月 20 日
If you didn't clip the rotated image to the canvass, but instead enlarged the canvass, it might appear to be shrunk because it may fit the enlarged canvass into the same display area.

サインインしてコメントする。

その他の回答 (2 件)

Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 25 日
Hi, I have read your message to my email.
I see your problem.
Imrotate cannot rotate an image in z - direction.
Please try imtransform instead.
Maybe this helps.
Eq:
I = imread('football.jpg');
Dorig = [0 0; 1 0; 1 1; 0 1];
Dtrans = [-4 2; -8 -3; -3 -5; 6 3];
tform = maketform('projective',Dorig,Dtrans);
B = imtransform(I,tform,'udata',[0 1],'vdata',[0 1],'size',size(I));
imshow(B);

Walter Roberson
Walter Roberson 2012 年 6 月 16 日
編集済み: John Kelly 2015 年 3 月 12 日
If you want to be able to rotate an image dynamically, then you need to create it as a texture map.

Community Treasure Hunt

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

Start Hunting!

Translated by