a=imread('2.jpg');
[height,width,dim]=size(a);
tform=maketform('affine',[-1 0 0;0 1 0;width 0 1]);
b=imtransform(a,tform,'nearest');
tform2=maketform('affine',[1 0 0;0 -1 0; 0 height 1]);
c=imtransform(a,tform2,'nearest');
subplot(1,3,1),imshow(a);
title('原图像');
subplot(1,3,2),imshow(b);
title('水平镜像');
subplot(1,3,3),imshow(c);
title('竖直镜像');
img 镜像
最新推荐文章于 2024-07-09 15:01:41 发布