您的位置:首页 > 其它

矩阵索引的使用——裁剪,颠倒

2016-01-16 00:18 148 查看
%矩阵索引的作用
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))')




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: