matlab实现图像的平移、旋转、缩放

clear;
close all;

img1=imread('bmoban.jpg');
img1=rgb2gray(img1);
figure,imshow(img1);
imwrite(img1,'a1.jpg');
%%%%%%平移
se=translate(strel(1),[20 20]);
img2=imdilate(img1,se);
figure,imshow(img2);
imwrite(img2,'a2.jpg');
%%%%%%旋转
img3=imrotate(img1,90);
figure,imshow(img3);
imwrite(img3,'a3.jpg');
% %%%%%缩放
img4=imresize(img1,2);
figure,imshow(img4);
imwrite(img4,'a4.jpg');

你可能感兴趣的:(matlab)