>> b=imcrop(a,[75 68 130 112]);
% I2 = IMCROP(I,RECT)
% RECT is a 4-element vector with the form [XMIN YMIN WIDTH HEIGHT];
% subplot(121)一行两列的显示,当前显示第一个图片
>> subplot(121);imshow(a);
>> subplot(122);imshow(b);
·roipoly 选择图像中的多边形区域
>> a=imread('onion.png');
>> c=[200 250 278 248 199 172];
>> r=[21 21 75 121 121 75];
>> b=roipoly(a,c,r);
>> subplot(121);imshow(a);
>> subplot(122);imshow(b);
·roicolor 按灰度值选择的区域
>> a=imread('onion.png');
>> i=rgb2gray(a);
>> b=roicolor(i,128,255);
>> subplot(121);imshow(a);
>> subplot(122);imshow(b);
评论5
最新资源