1、实现内容:图像旋转45度,向左偏移10像素,按照0.5比例进行缩放
2、Matlab编码实现
- 2.1、图像读取
-
% 加载本地图片 clc; clear all; figure; img = imread('C:\Temp\2012_004319.jpg'); imshow(img); title('原图');
2.2、图像旋转45度
% 图片旋转45°
img1 = imrotate(img,45,'bilinear','crop');
figure;
imshow(img1);
title('旋转45°后的图像');
- 2.3、向左偏移10像素
% 向左平移10像素
img2 = imtranslate(img,[-10,0]);
figure;
imshow(img2);
title('向左平移10像素后的图像');
- 2.4、按照0.5比例进行缩放
% 缩小到原来的0.5倍
img3 = imresize(img,0.5);
figure;
imshow(img3);
title('缩小0.5倍后的图像');