]);
grid on; %显示网格线
axis on; %显示坐标系
I4=edge(I1,'Prewitt');
subplot...=[lines(k).point1;lines(k).point2];
plot(xy(:,1),xy(:,2),'LineWidth',2,'Color','green');
plot(xy(1,1...),xy(1,2),'x','LineWidth',2,'Color','yellow');
plot(xy(2,1),xy(2,2),'x','LineWidth',2,'Color','red')...for k=0:255
GP(k+1)=length(find(I1==k))/(m*n); %计算每级灰度出现的概率,将其存入GP中相应位置
end
subplot(2,2,2...axis on; %显示坐标系
17.开启和闭合操作
用MATLAB实现开启和闭合操作
I=imread('xian.bmp');