How to rotate an image along y-axis?
7 ビュー (過去 30 日間)
古いコメントを表示
I want to rotate an image along y-axis. I tried using 'rotate' command of MATLAB but could not succeed. Can anyone plz help?
0 件のコメント
回答 (2 件)
Nitin
2014 年 1 月 22 日
Alternatively, you can try flipdim or rot90
3 件のコメント
Kritika
2015 年 2 月 4 日
Hello,
I also have the same problem as of your.Hoping that you might have found some solution to this problem.So, Please share your solution with me. you can mail me at kritikamittal1991@gmail.com
Image Analyst
2015 年 2 月 4 日
If you want rotation along the y axis instead of the z axis, then the image will appear foreshortened (narrower), thus the width is reduced. So you can simply use imresize() to calculate the new size. The new number of columns will be
theta = pi/12; % Whatever.
[rows, columns, numberOfColorChannels] = size(originalImage);
newColumns = columns * cos(theta);
rotatedImage = imresize(originalImage, [rows, newColumns]);
This will be like you're tilting the right edge of the image towards you as you look down along the z axis to it (looking at the image perpendicularly).
2 件のコメント
Image Analyst
2015 年 2 月 4 日
Yes, if you rotate along the y axis, the image will rotate out of the plane and you will be looking at it "edge-on". It will be a column vector. Similarly if you rotate 90 degrees about the x axis, you will get a row vector. I don't know why you'd want to do that, but you can use imshow() to visualize the new edge-on image.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!