图像剪切、旋转与缩放习题

练习1

练习内容

分别显示图像的奇数行和奇数列,偶数行和偶数列

代码呈现

1
2
3
4
5
A = imread('/Users/roarboil/Desktop/1.jpg');
I1 = A(1:2:end,1:2:end,:);
I2 = A(2:2:end,2:2:end,:);
subplot(1,2,1);imshow(I1);
subplot(1,2,2);imshow(I2);

代码解析

主要是用到了一个矩阵切片的机制

呈现效果

Author: YihangBao
Link: https://roarboil.github.io/2020/04/22/imarotpra/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.