Transformation matrix to rotate image
4 次查看(过去 30 天)
显示 更早的评论
I'm trying to find a matrix such that its multiplication with another matrix rotates the latter :
Let
be my image/matrix and
the vectorized image/matrix.
I'm looking for a "rotation" matrix F such as
where
is the vectorized rotated image.
Here's what I tried :
by identification 
Any idea on how construct such matrix with matlab ?
0 个评论
采纳的回答
Matt J
2023-2-10
See the section Image Transformations with Localized Responses (localfunc2mat) under the Examples tab of this FEX download,
5 个评论
Matt J
2023-2-13
编辑:Matt J
2023-2-13
Did you read the demo under the Examples tab that I referenced? You should have found a direct demonstration there. Here it is again:
xsiz=[256,256];
X1=imresize( double(im2gray(imread('cameraman.tif'))) ,xsiz);
X2=imresize( double(im2gray(imread('peppers.png'))) ,xsiz);
tic;
[A,ysiz]=localfunc2mat(@(x) imrotate(x,-30,'crop') ,...
xsiz,2); %convert to matrix form
toc
Y1=reshape( A*X1(:) , ysiz); %rotate images with matrix multiplication
Y2=reshape( A*X2(:) , ysiz);
montage({X1,Y1,X2,Y2},'DisplayRange',[0,256],'Size',[2,2])
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

