How to Rotate an image about center vertical axis?
3 次查看(过去 30 天)
显示 更早的评论
Hello I am using Image Processing Toolbox. How to Rotate an image about center vertical axis?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190911/image.jpeg)
Ofcourse the new pixels in the rotated image would be black ;p Thanks
采纳的回答
Guillaume
2018-5-30
Remember that a images are 2D constructs. They don't have a 3rd dimension and therefore can't be rotated in a 3rd dimension. What you're asking is to simulate the concept of rotating a 2D surface in a 3d space. The actual transformation that simulate that is not a rotation, but a projection. This is achieved by using imwarp with a projective2d transformation (which you can create a number of different ways), e.g.:
tform = projective2d([1 -0.1 0.001; 0 1 0; 0 0 1]);
newimage = imwarp(yourimage, tform);
imshowpair(yourimage, newimage, 'montage');
0 个评论
更多回答(2 个)
Image Analyst
2018-5-30
Steve Eddins's blog talks about this: https://blogs.mathworks.com/steve/2006/08/04/spatial-transformations-defining-and-applying-custom-transforms/
0 个评论
Image Analyst
2018-5-30
Did you try the rotation icon in the toolbar of the figure? Then use the File Menu to tell it to generate code.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!