%用处:选择一幅彩色图像,将其变作灰度图,再做上下、左右颠倒,逆时针90°,顺时针180°
figure(1);
RGB = imread(\'my.jpg\',\'jpg\');%此时 my.jgp文件在默认的路径下,否则GRB=imread(‘路径’);
subplot(3,2,1);
imshow(RGB);
title(\'彩色\');

GRAY=rgb2gray(RGB);%彩色图片变成灰色图
subplot(3,2,2);
imshow(GRAY);
title(\'灰色\');

[X]=GRAY;
Y=flipud(X);%矩阵上下翻转
subplot(3,2,3);
imshow(Y);
title(\'上下翻转\');

[i]=GRAY;
j=fliplr(i);%矩阵左右翻转
subplot(3,2,4);
imshow(j);
title(\'左右翻转\');

A = imrotate(GRAY,90,\'bilinear\');
subplot(3,2,5);
imshow(A);
title(\'逆时针90°\');

B=imrotate(GRAY,180,\'bilinear\');
subplot(3,2,6);
imshow(B);
title(\'顺时针180°\');