function imrotate_(path,theta) %这里的path为读入的图像路径
close all;
I=imread(path);
[h,w,m]=size(I);
theta=(theta/180)*pi;
%%——定义四个顶点坐标
coord(1,1)=-w/2;coord(1,2)=h/2;
coord(2,1)=w/2; coord(2,2)=h/2;
coord(3,1)=w/2; coord(3,2)=-h/2;
coord(4,1)=-w/2;coord(4,2)=-h/2;
%%--坐标变换矩阵1
C1=[1 0 w/2;
0 -1 h/2;
0 0 1 ];
%%--角度旋转变换矩阵
A=[cos(theta) sin(theta) 0;
-sin(theta) cos(theta) 0;
0 0 1];
A1=[cos(theta) -sin(theta) 0;
sin(theta) cos(theta) &nbs
matlab中简单的图像旋转算法
最新推荐文章于 2025-05-31 09:20:56 发布