%矩阵索引的作用 close all;clear all;clc I=imread(‘rose.tif‘); subplot(221),imshow(I),title(‘imshow(I)‘) %行序号颠倒,上下颠倒 subplot(222),imshow(I(end:-1:1,:)),title(‘imshow(I(end:-1:1,:))‘) %列序号颠倒,左右颠倒 subplot(223),imshow(I(:,end:-1:1)),title(‘imshow(I(:,end:-1:1))‘) %裁剪 subplot(224),imshow(I(257:768,257:768)),title(‘imshow(I(257:768,257:768))‘) %二次取样 figure,imshow(I(1:2:end,1:2:end));title(‘imshow(I(1:2:end,1:2:end))‘)
时间: 2024-09-30 10:51:25