水平:
clear all;
close all;
A= imread('C:\Users\revoll\Desktop\1.png');
B=size(A);
imshow(A);
for i=1:3
a0=[];
for j=1:B(2)
L=A(:,:,i);
H=[L(:,j),a0];
a0=H;
end
M(:,:,i)=H;
end
figure
imshow(M)
saveas(gcf,'flipud.png');
垂直:
clear
A= imread('C:\Users\revoll\Desktop\1.png');
B=size(A);
imshow(A);
for i=1:3
a0=[];
for j=1:B(1)
L=A(:,:,i);
H=[L(j,:);a0];
a0=H;
end
M(:,:,i)=H;
end
figure
imshow(M)