clear;
clc;
%读取原始图像
a=imread('273.jpg'); %原图片为273*273*3维矩阵
figure;
imshow(a,[]);
%图像分割成9份
b1=a(1:91,1:91,:);
figure;
subplot(3,3,1);
imshow(b1,[]);
b2=a(1:91,92:182,:);
subplot(3,3,2);
imshow(b2,[]);
b3=a(1:91,183:273,:);
subplot(3,3,3);
imshow(b3,[]);
b4=a(92:182,1:91,:);
subplot(3,3,4);
imshow(b4,[]);
b5=a(92:182,92:182,:);
subplot(3,3,5);
imshow(b5,[]);
b6=a(92:182,183:273,:);
subplot(3,3,6);
imshow(b6,[]);
b7=a(183:273,1:91,:);
subplot(3,3,7);
imshow(b7,[]);
b8=a(183:273,92:183,:);
subplot(3,3,8);
imshow(b8,[]);
b9=a(183:273,183:273,:);
subplot(3,3,9);
imshow(b9,[]);
评论0